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.
-
@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
-
@gregor said in Autosave Sessions and Sessions Panel Mods:
@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,
Yes, but it's only initial default value. This setting won't take any effect if you have used mod at least once. Open V settings (1st section of settings) to change this setting:
-
Update on my previous comment.
Tinkered with js a bit (using Advanced Panels code) and this change partially fixes it:
Changed this:vivaldi.sessionsPrivate.open( session, {openInNewWindow: newWindow} );
To this:
vivaldi.sessionsPrivate.open( vivaldiWindowId, session, {openInNewWindow: newWindow} );
With this change "Open in new window" works properly. "Open in this window" still doesn't work properly, but it seems to be the Vivaldi bug. Because the "Open in this window" doesn't work properly even in in-built session manager.
-
@artemgur said in Autosave Sessions and Sessions Panel Mods:
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
It seems that Vivaldi API has been changed between 4.0 and 4.3 Vivaldi versions. I've fixed this issue, but haven't intensively tested the fixed mod yet. Redownload new mod version either from GitHub or from mediafire.com.
-
Sessions Panel mod: I've fixed date representation in sessions name for US/UK date format (now 10.05.2021 will be 10/05/2021 if you are using imperial system). Redownload mod from 1st post links.
-
@boroda74 said in Autosave Sessions and Sessions Panel Mods:
@gregor said in Autosave Sessions and Sessions Panel Mods:
@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,
Yes, but it's only initial default value. This setting won't take any effect if you have used mod at least once. Open V settings (1st section of settings) to change this setting:
But what if I don't want to use Sessions Panel mod?