• Browser
  • Mail
  • News
  • Community
  • About
Register Login
HomeBlogsForumThemesContributeSocial

Vivaldi

  • Browser
  • Mail
  • News
  • Community
  • About

Navigation

    • Home
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    We will be doing maintenance work on Vivaldi Translate on the 11th of May starting at 03:00 (UTC) (see the time in your time zone).
    Some downtime and service disruptions may be experienced.
    Thanks in advance for your patience.

    1. Home
    2. Desktop
    3. Customizations & Extensions
    4. Modifications
    5. AutoSave Sessions Mod

    AutoSave Sessions Mod

    Modifications
    sessions modding javascript
    28
    134
    22.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • LonM
      L
      LonM Soprano Patron Moderator @gulbrain
      last edited by

      @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.

      πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

      G
      zyrfyth
      Z
      2 Replies Last reply
      Reply Quote 1
      • G
        gulbrain @LonM
        last edited by

        @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.

        1 Reply Last reply Reply Quote 1
        • zyrfyth
          Z
          zyrfyth @LonM
          last edited by zyrfyth

          @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.
          aae483f9-ee99-4aa0-845a-b6ccfa279ae0-image.png
          What to do?

          LonM
          L
          1 Reply Last reply
          Reply Quote 0
          • LonM
            L
            LonM Soprano Patron Moderator @zyrfyth
            last edited by

            @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

            πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

            zyrfyth
            Z
            1 Reply Last reply
            Reply Quote 0
            • zyrfyth
              Z
              zyrfyth @LonM
              last edited by zyrfyth

              @LonM said in AutoSave Sessions Mod:

              vivaldi://inspect

              Uncaught TypeError: Cannot read property 'insertAdjacentElement' of null
              at modSettingsPage (custom.js:150)

              18ae9aa2-8520-49ad-9dd3-a5f7f7395336-image.png

              I checked the source code custom.js - it matches the one posted in the first post.

              LonM
              L
              2 Replies Last reply
              Reply Quote 0
              • LonM
                L
                LonM Soprano Patron Moderator @zyrfyth
                last edited by

                @zyrfyth OK. I will look into this.

                πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                1 Reply Last reply Reply Quote 0
                • LonM
                  L
                  LonM Soprano Patron Moderator @zyrfyth
                  last edited by

                  @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.

                  πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                  zyrfyth
                  Z
                  1 Reply Last reply
                  Reply Quote 2
                  • zyrfyth
                    Z
                    zyrfyth @LonM
                    last edited by zyrfyth

                    @LonM Yes!!! It works!!!
                    Replace old custom.js with new autoSaveSessions.js in the folder and browser.html - and settings shows again.
                    Thanks.

                    LonM
                    L
                    1 Reply Last reply
                    Reply Quote 3
                    • LonM
                      L
                      LonM Soprano Patron Moderator @zyrfyth
                      last edited by

                      @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.

                      πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                      1 Reply Last reply Reply Quote 4
                      • luetage
                        L
                        luetage Supporters Soprano
                        last edited by

                        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);
                                }
                            }
                        

                        github β—Š vfm

                        LonM
                        L
                        1 Reply Last reply
                        Reply Quote 5
                        • LonM
                          L
                          LonM Soprano Patron Moderator @luetage
                          last edited by

                          Looks good πŸ‘

                          πŸ’» Windows 10 64-bit Sopranos Builds β€’ en-GB β€’ πŸ—³ vote for features β€’ πŸ•΅οΈβ€β™€οΈ Code of Conduct β€’ 🐞 Report bugs

                          1 Reply Last reply Reply Quote 0
                          • luetage
                            L
                            luetage Supporters Soprano
                            last edited by

                            @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.

                            github β—Š vfm

                            rafiki
                            R
                            1 Reply Last reply
                            Reply Quote 2
                            • luetage
                              L
                              luetage Supporters Soprano
                              last edited by

                              @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.

                              Screenshot from 2021-03-02 03-37-16.png

                              github β—Š vfm

                              1 Reply Last reply Reply Quote 1
                              • rafiki
                                R
                                rafiki @luetage
                                last edited by

                                @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.

                                1 Reply Last reply Reply Quote 0
                                • rafiki
                                  R
                                  rafiki
                                  last edited by

                                  @guigirl Thank you. I'll give it a whirl.

                                  1 Reply Last reply Reply Quote 0
                                  • rafiki
                                    R
                                    rafiki
                                    last edited by rafiki

                                    @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?

                                    luetage
                                    L
                                    1 Reply Last reply
                                    Reply Quote 1
                                    • luetage
                                      L
                                      luetage Supporters Soprano @rafiki
                                      last edited by

                                      @rafiki It’s determined by the text you input and its function is to clearly distinguish automatically created sessions from manually ones.

                                      github β—Š vfm

                                      rafiki
                                      R
                                      1 Reply Last reply
                                      Reply Quote 1
                                      • rafiki
                                        R
                                        rafiki @luetage
                                        last edited by

                                        @luetage Thanks for the explanation.

                                        1 Reply Last reply Reply Quote 1
                                        • boroda74
                                          B
                                          boroda74 Translator
                                          last edited by boroda74

                                          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.

                                          1 Reply Last reply Reply Quote 3
                                          • boroda74
                                            B
                                            boroda74 Translator
                                            last edited by

                                            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

                                            code3
                                            C
                                            1 Reply Last reply
                                            Reply Quote 0
                                            Loading More Posts
                                            • Oldest to Newest
                                            • Newest to Oldest
                                            • Most Votes
                                            Reply
                                            • Reply as topic
                                            Log in to reply
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 7
                                            • 5 / 7
                                            • First post
                                              Last post

                                            Looks like your connection to Vivaldi Forum was lost, please wait while we try to reconnect.

                                            Copyright © Vivaldi Technologies™ β€” All rights reserved. Privacy Policy | Code of conduct | Terms of use | Vivaldi Status