Modding Vivaldi
-
@hlehyaric said in Modding Vivaldi:
@laingman You don't have to modify
browser.html
anymore for CSS mods only. Just create a CSS file, put it in a folder outside the application and select it (follow «Adding Style», «Vivaldi 2.6 and above» instruction).Be careful with mods. Vivaldi's code has changed over time and some older mods don't work any longer.
I don't follow, Adding Style ?
-
-
Это сообщение удалено! -
@Gwen-Dragon That's hopefully a good sign. Inbuilt javascript modding incoming ^^
-
Is there already some way to not to move manually browser.html and custom.js files into vivaldi folder every update?
-
@Gregor Of course there is, you can use a batch script to automate the process. Take a look at pinned topics on this forum board. But there is no official way. The official css modding would be ok, but for people who use javascript the extra step is still needed, so no point to split it up. We would really only need js not css modding built in, since we could load the css through javascript anyway…
-
I personally prefer to do it manually. Not that I expect significant if any changes to browser.html in a future update I still like to do a diff between the file I was using previously and the new one. It lets me review both the current default file and what mods I have running. I've noticed mods I had that were no longer necessary with this process and removed them.
In a way that's actually somewhat automated, as after review I can simply merge the differences between the two from the file I keep in my source tree into the new file from within the diff tool. Rather than actual manual file manipulation.
For similar reasons I keep every mod isolated in its own files. That makes it easier to identify what mods are installed, find the code to make any changes, and access the comments I wrote to mark the version/update date, understand the implementation and get links to the relevant sites and threads.
-
@BoneTone
browser.html
is patched not replaced in batch scripts. You can also automate patching multiple files. It's a matter of preference overall, but automatic patching is in no way an inconvenience. You can also create batch scripts to save the changes you make to the live files back to storage should anything need to be fixed. Personally I think
manually copying the files over becomes a nuisance on snapshots over time. -
@Gregor said in Modding Vivaldi:
Is there already some way to not to move manually browser.html and custom.js files into vivaldi folder every update?
If you use WINDOWS the most convenient is: Vivaldi Mod Manager
-
A "this tripped me up" anecdote, in case anyone else is as much of an extreme dummy newbie as me :
There is nothing special about custom.js. It's just a placeholder filename to explain the instructions. The instructions even say that, but it took me a while to catch on.
I thought at first that custom.js was somehow necessary to make every other customization work, but that is wrong. It's browser.html that makes everything else work.
Also, you can't put code for more than one modification into the same .js file, even one called custom.js (...go ahead and laugh). You need a separate .js file for each mod.
For instance if you're adding blueMod and greenMod, you need two separate files in
"YOURVIVALDIDIRECTORY\Application\VERSION\resources\vivaldi"- blueMod.js
- greenMod.js
and two separate lines in browser.html
- <script src="blueMod.js"></script>
- <script src="greenMod"></script>
-
@Inclement There's nothing wrong with creating a file for each mod, but you can as well put all js mods into one file, it works too. It's simply a matter of preference in setup.
-
@luetage Oh. Well then that's not the mistake that caused my second mod not to work at first, nor what fixed it. Oh well. My spiffy mods are working, and now I know there's an option. Thanks!
-
Since it wasn't mentioned before, I'd like to point out that you can also use vivaldi://inspect/#apps to inspect the browser.html without depending on remote debugging or enabling the debug flag. It's the top most entry in that list that titles Vivaldi. Just click inspect underneath and there you go. (Tried on v3)
You can press F5 with the devtools window being focused to reload Vivaldi without restarting it.
-
Has someone tried using the experiment for css modifications in the latest snapshot? I did only try it when it first came out, but I immediately went back to loading it myself. When I tried it again today, it didn’t load the css file from the given directory.
-
@luetage For me it works pretty well. Are you sure that...? (basic questions, I know)
- you restarted Vivaldi
- you use the correct dir name
- the dir path doesn’t contain spaces (applies also to files)
- just for case also diacritics
- all the files end with
.css
-
@luetage Tis still fine here.
-
@potmeklecbohdan yeah, this is not a standard troubleshooting issue. I don’t care too much anyway, since I will continue loading css manually, just wanted to test the standard Vivaldi functionality out again and in my case it doesn’t work at all.
-
It’s working on latest snapshot. I kept the experiment on when it didn’t work and now the css file shows up in the sources tab. It’s rare that something fixes itself without intervention, but I won’t complain ^^
-
I cannot find browser.html on mac on latest version. Has the location changed?
-
@dehyde I doubt it. Where are you looking?