Autosave Sessions and Sessions Panel Mods
-
Here are my two versions of "AutoSave Sessions" and "Advanced Panels (with Sessions Panel)" mods by @LonM.
Autosave Sessions (I mean my version of original mod) doesn't require browser restart if any mod setting is changed. All changes of settings are applied in real-time. Even more: mod will try to correctly reschedule autosavings if you've change autosave period, subtracting time elapsed from last autosave from new first autosave delay (but of course not from subsequent delays). Mod will autosave session immediately (only first time) if you decreased autosave period and time elapsed from last autosave is too long. Also, settings changes made in one Vivaldi window will become visible in all opened Vivaldi windows (not immediately, but in one minute or less). Mod won't autosave session if the number of opened tabs and their content aren't changed since last autosave. This prevents deletion of old autosaves if they have different content. All other remarks for original mod by @LonM are applicable to my version also, so I'll repost part of them here:
-
When you are configuring the mod, read the comments carefully, as there are caveats to the kind of session name you can use, how often to save.
-
If you want to keep every single old session (NOT RECOMMENDED), use Infinity - type it just like that, no quotes, it's a valid JavaScript value. This will probably break your system through filling your disk storage space up, but if you want the option - it's there.
-
TIMEZONES & Daylight Saving time: Some sessions may not be created properly / older ones overwritten incorrectly if your computer switches time zone, or if daylight saving time occurs during a save period.
-
Some mod stuff can be configured in a Vivaldi settings (1st section of Vivaldi settings tab, at the top of tab see "AUTOSAVE SESSIONS MOD" header and mod settings below the header. You MUST set up Vivaldi to show settings in TAB to see mod settings, there is NO possibility to view/change mod settings if you set up Vivaldi to show settings in separate WINDOW).
-
This mod supports localization. At the time of writing, only English and Russian localizations are supported.
-
Mod appends exclamation mark to session name if there is opened private window(s) during autosaving (private window(s) won't be saved to such session) and double exclamation marks if private window(s) is saved to a given session (private windows are saved to own sessions if you tick autosaving of private windows(s) in mod settings).
You can open autosaved sessions from the usual place:
Installation
As autosave-sessions.js file according to these instructions or install autosave-sessions.js file using this application (much more convenient, but this app is for Windows only). Mod Manager Application is available only as source files on gitlab.com, so I've compiled it for you. Unpack "VivaldiModManager" folder from archive to your "Vivaldi\Application" folder and run "VivaldiModManager.exe" from "Vivaldi\Application\VivaldiModManager" folder.
Don't miss application menu shown by clicking on application icon
You can also download this mod as .zip archive (unpack autosave-sessions.js to some temporary directory and install it).
- NOTE: Vivaldi will remove all mods on any upgrade, and you will need to reinstall all mods again after Vivaldi upgrade. VivaldiModManager could make mods migration to upgraded Vivaldi very easy.
Sessions Panel mod is a slight modification of Advanced Panels mod by @LonM. I've changed the look and sometimes behavior of mod panel fixing some issues I've found. Of course, you can use native Vivaldi session management, but mod will be displayed in the side panel, not blocking the entire Vivaldi window, and the mod displays more user-friendly session names (and tooltips over session names) for sessions created by Autosave Sessions mod or Sessions Panel mod itself.
NOTES:
-
It's possible to ctrl-click (add session to selection/remove it from selection), shift-click (select range) or alt-click (select all, click on any session) in session list.
-
It's possible to overwrite existing session, but private sessions can be overwritten only from private Vivaldi window, and not private sessions can be overwritten only from not private Vivaldi window (it's artificial limitation to avoid accidental mistakes).
-
You must manually open private window and open saved private session from this window if you want to continue private browsing, otherwise saved private session will be opened as not private session.
Demo
Installation
As sessions-panel.js and sessions-panel-classic-colors.css files according to these instructions or install them using (already compiled) VivaldiModManager.
You can install alternative stylesheet sessions-panel-theme-colors.css if you want Session Panel mod to use Vivaldi theme colors, but don't install both stylesheets simultaneously!
You can also download this mod as .zip archive (unpack sessions-panel.js and sessions-panel.css to some temporary directory and install it).
The mod requires that you first add your own web panel manually, with a URL set to vivaldi://sessions
- This mod supports localization. At the time of writing, only English and Russian localizations are completely supported. There are also some other localizations included, but they are slightly outdated (strings that I've added for my version of original @LonM's mod are in English at the moment).
Bonus
Here is my bundle of Vivaldi UI/UX mods I've found on the forum. I've reduced/simplified these mods leaving only pleasant to me enhancements:
-
Add a thin blue bar at the top of active page tab header (like in Firefox).
-
Move find in page bar to the bottom of Vivaldi window.
-
Change the look of sync tabs and tab trash buttons.
-
Add transition/animation on tab switching.
-
Discarded tabs have grayed out text, not only icon
Installation
As ui-mods-pack.css file according to these instructions or install it using (already compiled) VivaldiModManager.
You can also download this mod as .zip archive (unpack "ui-mods-pack.css" to some temporary directory and install it).
-
-
An update of both mods:
- UI/UX improvements and some bug fixes
- Now changing localization of both mods can be made in UI (without changing constants in source code). All changes (including localization changes) are applied immediately (browser restart is not required).
- Now it's possible to overwrite existing session, but private sessions can be overwritten only from private Vivaldi window, and not private sessions can be overwritten only from not private Vivaldi window (it's artificial limitation to avoid accidental mistakes).
Links to GitHub mod sources and .zip files are the same. See 1st post.
-
Update of Session Panel mod:
- Fixed bug, when all sessions in session list had been duplicated after Vivaldi minimize/restore.
-
This post is deleted! -
- can Autosave Sessions be set to open/restore tabs from private window in private window (not in normal window)?
- can private window sessions have something like "private" in the name, instead of "!!"?
- can time looks like 15:24 instead of
? - can private sessions have MAX_OLD_SESSIONS so they can be overwritten by normal session?
-
While searching the web, I found your mod before LonM's original (from your ref. to it). After attempting to install your Session Panel mod first, I found that it doesn't seem to work. Selecting the the Web Panel (vivaldi://sessions) results in a "This site can't be reached" message. However, after installing LonM's Advanced Panels Mod, it works just fine.
I'd like to get your mod working, especially if it is significantly improved over LonM's. But my knowledge of JavaScript isn't quite up to the job of debugging your code. Of course I'm assuming it's a bug, as I did get LonM's mod working.
-
@boroda74, just like @ShadesOfGrey, I cannot use
vivaldi://sessions
.I have modified
browser.html
to includeautosave-sessions.js
andsessions-panel.js
(at the end of<body>
). I have copied both files into/opt/vivaldi-snapshot/resources/vivaldi
(I use Linux, specifically Fedora 34).Neither of the scripts work.Actually,autosave-session.js
works, but I have no idea where can I configure it.In the web console, I see the following errors:
Uncaught ReferenceError: init is not defined at initMod (sessions-panel.js:1573) at advancedPanels (sessions-panel.js:1577) at sessions-panel.js:1578 [ vendor-bundle.js:
Where is that
init
defined? I cannot fined its definition insessions-panel.js
. Is is something provided by Vivaldi? -
@gregor said in Autosave Sessions and Sessions Panel Mods:
- can time looks like 15:24 instead of
?
Fixing this is quite easy: open
autosave-sessions.js
in a text editor (like Notepad on Windows or Gedit on Linux; better editors: Sublime Text, VS Code, Notepad++) and edit line 92 fromlet escaped = date.toLocaleString().replace(/:/g, "`");
tolet escaped = date.toLocaleString());
. With a bit of JavaScript knowledge you can change the name of the saved session to whatever you want.Update: I think that @boroda74 choose to replace semicolon due to Windows and its filename rules: on Windows, semicolons cannot be used as filenames. Sessions are stored on Linux into
~/.config/vivaldi-snapshot/Default/Sessions/
as files, therefore they cannot contain semicolons in session names on Windows. On Linux and macOS, I can freely use any character except for slash. - can time looks like 15:24 instead of
-
I have a feature request: I am used to Workona, which I want to ditch. I’d like to have named sessions (in Workona termilogy: workspaces) which would be autosaved once in a period of time with the same name as the session currently open.
I have no idea if Vivaldi associates windows with session names (probably not), therefore we might want to create a file (possibly a JSON) with window-session association. This part is hard for me, as I have never hacked Vivaldi yet.
The rest seems to be already implemented, just needs to be modified for this.
Actually, it might be good idea to borrow some ideas from Sublime Text, which IMHO manages sessions (aka workspaces, sometimes called _projects) perfectly: it creates JSON files for each workspace. Each workspace is a single window. I wish I could have something like that in a web browser, it does not matter if its Firefox or Vivaldi.
If we would go the Sublime Text way, we might want to create custom session/workspace files, custom session manager and custom panel/pop-up to manage them. Actually, in Sublime Text editor I use Project Manager, which would be nice to implement in Vivaldi.
-
@tukusejssirs You can access autosave sessions settings in
vivaldi://settings/general/
. I’m using both Fedora 34 and this mod (well, the original not this one), so it should work. The initMod is a function loading the session panel mod, when it fails the mod won’t load. Hard to tell what’s going wrong, make sure to follow instructions from the original topic carefully. Personally I think the sessions panel isn’t useful, since it doesn’t provide additional functionality compared to the inbuilt sessions. In truth sessions need an overhaul by the Vivaldi team, or we will have to come up with something useful ourselves. -
Confirmation of delete saved sessions
https://forum.vivaldi.net/post/189164 -
Here's what I'm getting in the DevTools Console:
Clicking on the the links results in switching to the Sources tab with this:
From what I can gather, vivaldi://sessions is seen as invalid. "crbug/1173575" seems to commonly refer to malformed URLs that reference the incorrect port number of a given HTTP server. The weird thing is that LonM's Advanced Panels works while boroda74's Sessions Panel does not. It's very odd, because both are pretty similar (after all boroda's code is a derivative based on LonM's). I can't see what would make one work and the other fail.
It's been a while since I did much coding, and I don't really understand how mods work/interact with Vivaldi. But it looks like refactoring both to isolate their differences is the only way I'll figure this out... I just hope my JS skills aren't too rusty (and too ignorant on how Vivaldi mods work) to figure this out.
FYI, I'm running Vivaldi on Windows 10 and I do not have the Autosave Sessions mod install. I don't know if this really has any bearing, but I figured I should mention it anyway.
-
Sorry for my english, can you modificate sessions panel ? For example, some check box or button, delete saved tabs. And maybe, when we type the name, highlight exist session for the fastest choose the needed session. I think its more useful for people who use sessions like cases (for news, music, etc).
-
These two mods do not work for me. Running Vivaldi 4.2.2406.52 on linux. I'm not getting any session panel and can't tell whether any autosaving is working. In the vivaldy dev console I see the following warning message:
sessions-panel.js:1489 Failed to find button for Sessions convertWebPanelButtonstoAdvancedPanelButtons @sessions-panel.js:1489
I also had to revert the change from calling
init
vs.initMod
. Now looking whether I can easily upgrade to 4.3...Update: upgraded to 4.3 and same issue...
-
Autosave Sessions script stopped working properly after new snapshots. It doesn't save/open private window and opening saved normal session causes duplicating pinned tabs.
Can someone fix this? -
@gregor said in Autosave Sessions and Sessions Panel Mods:
- can Autosave Sessions be set to open/restore tabs from private window in private window (not in normal window)?
- can private window sessions have something like "private" in the name, instead of "!!"?
- can time looks like 15:24 instead of
? - can private sessions have MAX_OLD_SESSIONS so they can be overwritten by normal session?
For 1: unfortunately it's not posible, V API doesn't allow to open any saved session in private window. You can open private window manually and restore private session from that window.
For 2 and 3: it's very strange. Are you using mod UI to look at saved sessions? Here is what I see:
If you mean native V session dialog, then not, it's not possible because session names are filenames, and filename can't contain ":" character.
For 4: private sessions have MAX_OLD_SESSIONS parameter (the same as for not private sessions), but they are counted separately than not private sessions (e.g. there are 2 session counts: one for private sesssions and one for not private ones).
-
@shadesofgrey said in Autosave Sessions and Sessions Panel Mods:
While searching the web, I found your mod before LonM's original (from your ref. to it). After attempting to install your Session Panel mod first, I found that it doesn't seem to work. Selecting the the Web Panel (vivaldi://sessions) results in a "This site can't be reached" message. However, after installing LonM's Advanced Panels Mod, it works just fine.
I'd like to get your mod working, especially if it is significantly improved over LonM's. But my knowledge of JavaScript isn't quite up to the job of debugging your code. Of course I'm assuming it's a bug, as I did get LonM's mod working.
That message means that mod is not initialized or installed. Do you install both mods? "Autosave sessions" and "Sessions Panel" mods are 2 different mods. "vivaldi://sessions" side panel will work only if installed second one (or installed both mods).
-
@tukusejssirs said in Autosave Sessions and Sessions Panel Mods:
@boroda74, just like @ShadesOfGrey, I cannot use
vivaldi://sessions
.I have modified
browser.html
to includeautosave-sessions.js
andsessions-panel.js
(at the end of<body>
). I have copied both files into/opt/vivaldi-snapshot/resources/vivaldi
(I use Linux, specifically Fedora 34).Neither of the scripts work.Actually,autosave-session.js
works, but I have no idea where can I configure it.In the web console, I see the following errors:
Uncaught ReferenceError: init is not defined at initMod (sessions-panel.js:1573) at advancedPanels (sessions-panel.js:1577) at sessions-panel.js:1578 [ vendor-bundle.js:
Where is that
init
defined? I cannot fined its definition insessions-panel.js
. Is is something provided by Vivaldi?Yes, there was a bug. It's fixed now. Redownload mod from any of the links from 1st post.
-
@boroda74 is this setting correct to enable saving private sessions?
Sory for asking, but there's no explanation what can be changed and where are the settings.id: "LONM_SESSION_SAVE_PRIVATE_WINDOWS", type: Boolean, default: true,
-
For some reason sessions don't open when I try to open them from the sidebar. When I click the button, nothing happens.
I can't open sessions neither in the current window nor in new window, neither one session nor multiple at once.
I use the latest version from Github