Advanced Panels Mod (with Sessions Panel)
-
@LonM This is a seperate question but what does historyCleanup.js do? I added it to config.json but my history looks the same.
-
@code3 where did you find historyCleanup?
-
@LonM On your GitHub. It looks interesting and could even speed up Vivaldi but I cannot get it to work.
-
@code3 I haven't used that mod in quite a while. It has no UI. Instead it was intended for my own use directly accessing it in the console. I would advise against keep it loaded as a mod. I'm not sure if I ever finished it.
-
@LonM Ok. Maybe I will try to work on it, it seems like it could be very useful.
-
@LonM I will try to work on a history cleanup mod. I'm thinking it's something that will not have a UI, but will run in the background on startup and remove items that can be linked to a similar item. I do have one question if you have time: why do you surround your mods in a ()();?
They look like:(function mod(){ })();
-
@code3 This way the functions inside the mod don't interfere with functions of the same name from another mod.
e.g. if I had two mods, both with an init() function, one could end up taking priority over the other.
By scoping them inside mod(){ ... } I make sure that only that mod can see the init() function.
-
@LonM Alright, I get that. So the initMod() functions don't interfere. However, I still don't get how the (mod(){})(); function actually runs, because functions usually must be called. Does it have anything to do with the surrounding parentheses?
-
@code3 It's javascript witchcraft. () after a function enclosed like that will make it run. And you can nest functions within other functions.
-
@LonM said in Advanced Panels Mod (with Sessions Panel):
It's javascript witchcraft
Thank you. I did not know.
-
@code3 They are called IIFEs (Immediately Invoked Function Expressions).
-
@nomadic thanks for the mdn link!
-
As of today, it does not seem very different from the session saving function. Does this modification serve as a way to have more direct access to this function? Or does it act independently?
-
I've slightly improved UI (in my opinion) and have added Russian localization:
https://drive.google.com/file/d/1BABlab3ukXqTDJqzZSHam5y9aGPOAhd_/view?usp=sharing
EDIT: It's now possible to shift-click (select range) and alt-click (select all, click on any session) in session list.
-
I've fixed some bugs and have improved UX.
See this topic for further reference:https://forum.vivaldi.net/topic/61132/autosave-sessions-and-sessions-panel-mods
-
Now the session list becomes scrollable if there are too many sessions to fit available web panel height.
https://forum.vivaldi.net/topic/61132/autosave-sessions-and-sessions-panel-mods
-
@ouros said in Advanced Panels Mod (with Sessions Panel):
a way to have more direct access to this function
Yes, it is a way to have more direct access to sessions, so you can open and save them quickly.
-
@lonm @Hadden89 I never finished the history cleanup mod, but I did modify the forum code to help prevent history pollution:
https://github.com/code3z/vivaldi_forum_mod/tree/less-history
(sorry for polluting this thread)
-
I'm sure you won't mind, @boroda74, if I chip in and offer my compliments for the great work you've done on the Sessions panel mod (and of course, thanks to @LonM for some brilliant work, and making the dream a reality the first place!)
Say, I've got a little question. The hamburger icon for the new panel isn't very representative, in my opinionβand it looks so puny and small next to the other icons, as well. Trouble is, I can't figure out how it's loaded (looking at the sources files I have here). I was wondering if you could explain how to change the icon?
(I'm a little bit embarrassed to ask, as I'm a developer myself, but I'm rather out off the touch with web dev and JavaScript, and anyway I find going into all these huge object hierarchies quite daunting. I'll get into Vivaldi modding later, when I have time to properly dig in, no doubt. Thanks if you can help in the meantime!)
-
@fryderyk If you look at
advancedPanels.js:365
you will see this:<path d="M7 2h6v1h-6v-1zm0 2h6v1h-6v-1zm0 2h6v1h-6v-1z"></path>
This is an SVG definition. You can change the SVG or embed an
<img>
if you wanted instead.I was never really sure what to use as the icon for a sessions panel.