Import and Export Themes
-
@luetage said in Import and Export Themes:
@Folgore101 You have to inspect Vivaldi's UI. Then you just paste and execute code in console – that I haven't written yet.
But hey, doesn't hurt to do an individual mod for this, I already know how to do these buttons anyway. Will take some time, since I gotta go now.
Thanks a lot, now i read that discussion and the 27 page one, even if it's in "Ancient Aramaic" maybe i can understand something.
-
@Folgore101 Maybe you will enjoy the 27 pages, but you likely won't find any useable code in there. Vivaldi has changed over the years.
-
@luetage Yes that's very likely, it's more to try to understand how .css works, I'm also reading some tutorials.
-
@Folgore101 It all depends on how you learn well. Personally, online coding tutorials have never helped me and were a complete waste of time, especially for javascript. First they are too easy and bore the hell out of you, later they get too specific and present examples you will never need again, but thereby not teaching you any core principles.
Thus, the easiest way to get into CSS is to jump right in and just do. Write a theme for any existing site. Get accustomed to finding elements you want to change in the html and looking up existing selectors and commands in the css, which is best practice in case of messing with other people's code. If you don't know how to do something you want to achieve, make a search on the web for it, it's almost certain someone had the same problem as you and was desperate enough to ask about it online – or you'll even find a blog post with explanations concerning your latest issue. This is gonna be tiresome in the beginning and you will spend hours and not achieve much, or anything at all, but it will build up your skill set slowly and over time you can reuse more and more.
-
@luetage
document.querySelector('button[title="Edit Theme"]')
don't work with me. I don't use english language -
This is true, but the Vivaldi devs give us more and more trouble in the latest release. Since there is neither an individual class nor id on this page, you run into the possibility to load the buttons in other sections of the settings. Moreover you already have to change the button titles anyway, they are all created in English.
I think this should work out fine for everyone though:
const btn = document.querySelector('.setting-group.unlimited button.selectbox + .toolbar-default .toolbar-group + .button-toolbar button');
-
@luetage Yeah, I understand. I am also looking for the best solution to the selector problems in the new Vivaldi version
-
@tam710562 Tell me if you find something other than combining common class selectors with specific titles. A perfect example would be the home button – how do you select it if not by title? Nowadays it could be either in the status bar, or in the address bar and it's placement within can change too… it's a mess.
-
@luetage
style
is added whenever you click on the menu itemThemes
invivaldi://settings/themes/
-
Good find, but I can't really explain it. The style can only be added should the move button not exist. This is triggered on mousedown, so can't have anything to do with the themes button. The next strange thing is the circumstance that it's added at most 3 times.
-
@luetage The steps I did
Step 1: Access addressvivaldi://settings/general/
Step 2: ClickThemes
Step 3: ClickGeneral
Step 4: ClickThemes
.... -
@tam710562 Yeah, found out why it happens, the header is kept when staying in settings and leaving themes. I gave the style an id and now it's only added once. OP updated. The same thing should happen for the mod to backup search engines – I changed that one too without even testing. It's better to prevent this to keep the html clean, although this error doesn't mess with the functionality of either the mods or Vivaldi itself. But good we got that settled, thanks for pointing it out!
-
I really want to see a shared theme preview from the vivaldi forum before importing.
I have tried writing a userscript and it looks good , though the color is not really true with vivaldi :smiling_face_with_open_mouth_cold_sweat:
The code can be viewed hereIt also creates previews for shared themes for Vivaldi Forum mod
-
@tam710562 That's not a bad idea, but when I wanted to test it just now Vivaldi complained about an invalid script header. Header looks fine to me, not sure what's going on.
-
@luetage Same for me. Wasn't there some kind of bug/regression some times ago, when we were not able to drag crx files into the extension page?
-
//edit: Tam just "fixed" it
-
@luetage I always use userscript in user script manager extensions like Tampermonkey
chromium doesn't seem to support@match
change// @match http*://forum.vivaldi.net/topic/*/*
to
// @include http*://forum.vivaldi.net/topic/*/*
-
@tam710562 Confirmed. Now it works
-
@Hadden89 Works me too now.
-
@tam710562 Even works for backups, good job. I don't know if you're using it, but we could implement this in the Forum mod, if you're interested.