AutoSave Sessions Mod
-
@gulbrain said in AutoSave Sessions Mod:
vivaldi://settings/general/
Make sure you have vivaldi settings configured to open in a tab, not a popup window, and it should appear when you open settings.
As far as I know, there is no way to retrieve sessions from sync.
-
@LonM Sorted - thank you.
I'd opened settings in a tab manually (by copying the "URL" spotted in the code), but that didn't work. Adjusting settings to open in a tab resolved it as soon as I clicked the settings cog again. -
@LonM The mod works (see picture), however, after updating the program to version 3.5.2115.81 (64-bit) the mod settings are no longer displayed. The settings are shown in a separate tab, not in the window.
What to do? -
@zyrfyth Try opening the inspector to see if there are any errors:
- Open
vivaldi://inspect
- Open the apps section
- Click the inspect button under vivaldi
- Look at the console tab
- Open
-
@LonM said in AutoSave Sessions Mod:
vivaldi://inspect
Uncaught TypeError: Cannot read property 'insertAdjacentElement' of null
at modSettingsPage (custom.js:150)I checked the source code custom.js - it matches the one posted in the first post.
-
@zyrfyth OK. I will look into this.
-
@zyrfyth Hi,
Could you try using the version of the mod located here:
https://raw.githubusercontent.com/LonMcGregor/VivaldiMods/master/mods/autoSaveSessions.js
(it has v4.1 at the top, so it is different to the main post)
Let me know if this updated version works for you.
-
@LonM Yes!!! It works!!!
Replace old custom.js with new autoSaveSessions.js in the folder and browser.html - and settings shows again.
Thanks. -
@zyrfyth glad to know that fixes it. It seems there was a timing problem. I will update the main topic post with this info.
Thanks for helping test the fix.
-
I changed the init function a little to load the new settings whenever the general category is being selected. In the current mod it only triggers on settings page creation and the new entries are lost when navigating away. Donβt think this created additional issues.
function init(){ if(window.vivaldiWindowId){ chrome.windows.getCurrent(window => { if(!window.incognito){ chrome.storage.local.set({ "LONM_SESSION_AUTOSAVE_LAST_WINDOW": window.vivaldiWindowId }, () => { setInterval(triggerAutosave, CURRENT_SETTINGS["LONM_SESSION_AUTOSAVE_DELAY_MINUTES"]*60*1000); }); } if(CURRENT_SETTINGS["LONM_SESSION_SAVE_PRIVATE_WINDOWS"] && window.incognito){ chrome.storage.local.set({ "LONM_SESSION_AUTOSAVE_LAST_PRIV_WINDOW": window.vivaldiWindowId }, () => { setInterval(triggerAutosavePrivate, CURRENT_SETTINGS["LONM_SESSION_AUTOSAVE_DELAY_MINUTES"]*60*1000); }); } chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { if (changeInfo.url === SETTINGSPAGE) { modSettingsPage(); } }) }); } else { setTimeout(init, 500); } }
-
Looks good
-
@guigirl Should work. I also deleted another function, since it isnβt being called anymore, but it doesnβt hurt leaving it in. Anyway, just mess around with it; the worst that could happen is you lose all your data and your computer goes up in flames, nothing to lose a good nightβs sleep over.
-
@LonM I hadnβt tried this mod before today and itβs funny Iβm discovering the same things apparently already discussed in this topic. About the date discussion, why use a readable date at all? Vivaldi already displays the creation date in our preferred format in the sessions popup, therefore itβs somewhat redundant. I switched it over to use epoch time, which is simple because itβs a readily available javascript function and sorts fine. Can also be easily converted to a proper date manually, should the need arise somehow. A matter of taste of course.
-
@luetage As an enthusiastic non-techie, before I make a complete hash of this may I know what the final full text should be, please? I looked at overwriting but I'm not exactly sure what I should be deleting and what should remain.
-
@guigirl Thank you. I'll give it a whirl.
-
@guigirl It's working fine. Thanks again. When I look at the settings I see a unique prefix. What is its function and how is it determined?
-
@rafiki Itβs determined by the text you input and its function is to clearly distinguish automatically created sessions from manually ones.
-
@luetage Thanks for the explanation.
-
I've added Russian localization to the mod and have enabled 0 minutes autosave period for disabling autosaving without uninstalling mod:
https://drive.google.com/file/d/1bWl0ihtoveqPc4WAdGi-AM7fNVNr6UIT/view?usp=sharing
EDIT: Also restarting browser if not required anymore after changing any setting.
-
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