History Clock (keeping easter egg alive)
-
This is a quick mod to keep the history clock working past 1st April. @Hadden89 has just posted a feature request for it, so maybe the Vivaldi devs will reintroduce the feature in a future version of the browser anyway, but in the meantimeβ¦
/* History Clock */ function historyClock() { const clock = document.querySelector('#switch button.history'); var time = new Date(); var hours = time.getHours(); var minutes = time.getMinutes(); if (clockSetInt === true) { if (clockRelax !== -1 && clockRelax !== minutes) { clearInterval(clockTimer) setInterval(historyClock, 60000); clockSetInt = false; } clockRelax = minutes; } if (clock) { clock.style = '--timeHourRotation: rotate(' + Math.floor(hours*30+minutes/2) + 'deg); --timeMinuteRotation: rotate(' + minutes*6 + 'deg)'; } }; var clockSetInt = true; var clockRelax = -1; var clockTimer = setInterval(historyClock, 1000);
-
Where do you write this script into, in which folder?
-
@Gwen-Dragon That is very complicated.
-
Nice, switched to 1/5/19 and it works.
Tomorrow I'll add the link to the feature request -
@Gwen-Dragon I can not save '<link ' stylesheet 'href =' style / custom.css '/>' in 'browser.html', I'm denied, I opened 'browser.html' in Word.
-
@stardepp You need to use a text editor, not a word processor to edit the file. I wanted to write german instructions for modding Vivaldi anyway⦠keep hanging in there.
-
@luetage Even with the editor will save me the store.
-
Now it worked, I activated my admin rights and now everything went fine.
-
@luetage said:
You can test this today (1st April) by changing your system clock to another date.
Or you can keep it without this mod by changing your system clock every day...
-
@potmeklecbohdan Or you can stop the system clock
-
- Then the clock would be useless
- Is that possible? How?
-
Everyone here posted a day ago, including this comment
-
Ok, it's 2nd April and the clock works. I did some improvements since initially posting, the code should be a bit more efficient. Additionally I tried to future proof it: Should Vivaldi decide to remove the feature completely in an upcoming version (which wouldn't be surprising), this mod should still continue working.
Also an interesting unrelated addendum, the standard watch hands ( "uneasteregged" ) don't show a valid time β one more reason to run the modβ¦
-
@luetage Should this script be copied into 'css' of this folder?
C:\Program Files (x86)\Vivaldi\Application\2.5.1503.4\resources\vivaldi
-
@stardepp
This actually depends on where the script points in browser.html1# Goes in \vivaldi
<script src="thismod.js"></script>
2# Goes in \vivaldi\style
<script src="style/thismod.js"></script>
As you followed modding guide, you probably want to use #1.
-
@stardepp It's not a "CSS" but a JS. You have to create a file called "history_clock.js", with inside the code written by @luetage, and copy it to C:\Program Files (x86)\Vivaldi\Application\2.5.1503.4\resources\vivaldi
Also in this folder edit the file "browser.html" adding this line:<script src="history_clock.js"></script>
next
<script src="bundle.js"></script>
-
@Folgore101 yeah, I read again the guide and it place js mods out the style folder whereas I always placed everything in style folder.
-
@Hadden89 Really!, you're the veteran, i'm just starting out with the mods. :smiling_face_with_open_mouth_cold_sweat:
-
@Folgore101 Yes, I understood that now, but when saving the modified 'browser.html' file comes this error, although I am an administrator.
-
@stardepp Try to make a copy of browser.html in a "neutral path" like c:\browser.html (windows can be annoying with program files folder), do the need edit there and then replace the file moving it back in vivaldi folder (ovewriting).
Even with admin rights, sometimes windows decide you can't save the file.
Or you could try to open the editor as administrator and then the file. (This don't always works).