Fossil Forum

Skin bug fix: clock in Eagle, Enhanced Original, and Xekri doesn't update
Login

Skin bug fix: clock in Eagle, Enhanced Original, and Xekri doesn't update

Skin bug fix: clock in Eagle, Enhanced Original, and Xekri doesn't update

(1) By Warren Young (wyoung) on 2018-08-11 21:27:15 [source]

If you are using any of the above skins in your own Fossil repositories, the clock in the upper right corner probably isn't updating every minute like it should. This is due to the stricter CSP that Fossil has been declaring in recent versions.

I'm posting this since simply updating Fossil won't fix it. To fix it, you have to edit the Header of your skin, then find this line:

  setTimeout("updateClock();",(60-d.getUTCSeconds())*1000);

and change it to:

  setTimeout(updateClock,(60-d.getUTCSeconds())*1000);

That replaces a string of JavaScript code that the browser must eval — which it refuses to do now, because doing so would violate the CSP's strictures — to a Function object reference, which is safe to call.

I've applied this fix on trunk, but it will only affect new Fossil repositories or those whose skin is changed to one of these three skins after updating Fossil to the current trunk version or later.

General PSA: Diff your skin against the current definitions of those skins occasionally; on every major Fossil version upgrade, at least. You may find enhancements in the stock version of that skin that you'd like to reflect into your local version.