• 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. Archive
    4. How to prevent overwriting browser.html on update?

    How to prevent overwriting browser.html on update?

    Archive
    7
    30
    1.3k
    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.
    • Dancer18
      D
      Dancer18
      last edited by

      I have a custom.js and I don't want to fix browser.html that is overwritten on every update.
      How to do this?

      Vivaldi with mail-client and calendar
      OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

      Pathduck
      P
      1 Reply Last reply
      Reply Quote 0
      • Pathduck
        P
        Pathduck Moderator Soprano Supporters @Dancer18
        last edited by

        @dancer18 Hi - you can't.

        As I'm sure you're aware, during update the whole Vivaldi\Application\<version>\resources\vivaldi folder gets replaced. So you can't make it read-only either, and that would probably cause a crash during update anyway.

        Your best bet is probably making a script that does what you want and just run it after update.

        🎻Volunteer helper · Forum moderator · Sopranos tester 🛠️Troubleshooting 🐛Report a bug 📜Markdown help
        🦆"With a rubber duck, one's never alone" -Douglas Adams🦆

        Dancer18
        D
        ?
        LorenAmelang
        L
        3 Replies Last reply
        Reply Quote 2
        • Dancer18
          D
          Dancer18 @Pathduck
          last edited by

          @pathduck Yes that would do it. However, I have no idea how to set it up.
          Could you help? Or is there already a script as some other users might already need it for same reason?

          Vivaldi with mail-client and calendar
          OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

          Pathduck
          P
          1 Reply Last reply
          Reply Quote 0
          • Pathduck
            P
            Pathduck Moderator Soprano Supporters @Dancer18
            last edited by

            @dancer18 You are on Linux are you not? I thought all Linux users were shell-scripting experts? 😉

            Have a look here:
            https://forum.vivaldi.net/topic/10592/patching-vivaldi-with-batch-scripts

            🎻Volunteer helper · Forum moderator · Sopranos tester 🛠️Troubleshooting 🐛Report a bug 📜Markdown help
            🦆"With a rubber duck, one's never alone" -Douglas Adams🦆

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

              @pathduck Of course we are, all of us. It’s not like we copy/paste our code piecewise from dubious sources and build our very own Frankencode which we then share proudly with everyone else. That would be silly.

              github ◊ vfm

              1 Reply Last reply Reply Quote 3
              • ?
                A Former User @Pathduck
                last edited by

                @pathduck said:

                As I'm sure you're aware, during update the whole Vivaldi\Application\<version>\resources\vivaldi folder gets replaced.

                [a post later]

                You are on Linux are you not?

                these two things don’t seem right when combined; there’s no \ or <version>.

                Dancer18
                D
                1 Reply Last reply
                Reply Quote 4
                • Dancer18
                  D
                  Dancer18 @A Former User
                  last edited by

                  @potmeklecbohdan Here - Linux - it is /opt/vivaldi/resources/vivaldi

                  Vivaldi with mail-client and calendar
                  OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                  1 Reply Last reply Reply Quote 0
                  • LorenAmelang
                    L
                    LorenAmelang @Pathduck
                    last edited by

                    @pathduck

                    Is this maybe an option:
                    https://forum.vivaldi.net/topic/42039/vivaldi-boot-screen-not-dark/14

                    Briefly:
                    Go to the url vivaldi://experiments/ (you need to paste it into the url bar)
                    Enable the "Allow for CSS modifications" option
                    Go to Settings > Appearance and find "Custom UI modifications"
                    Browse for the folder you chose for your mods:
                    Like: C:\Users\loren\Documents\Backup Items\Vivaldi\Vivaldi Mods\LiveCSS

                    I put my 'bottom location for search bar' mods there, and haven't thought about them for a couple of years now. Or maybe the default Vivaldi adopted them?

                    Oh, I guess the "Live" thing doesn't mod .js files, or at least didn't two years ago. And that was the original question here.

                    System76 gazp9, Arch Linux; Raspberry PI 5, Debian Bookworm; iPad 12.9 5Gen; iPhone SE2020; synched...

                    Dancer18
                    D
                    1 Reply Last reply
                    Reply Quote 0
                    • Dancer18
                      D
                      Dancer18 @LorenAmelang
                      last edited by

                      @lorenamelang Yes, no problem with custom.css that is stored somewhere in profile folder.

                      But custom.js has to be integrated into the browser.html in the program directory.

                      Vivaldi with mail-client and calendar
                      OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                      1 Reply Last reply Reply Quote 0
                      • Dancer18
                        D
                        Dancer18
                        last edited by

                        @luetage Maybe you have an answer to my question?

                        Vivaldi with mail-client and calendar
                        OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

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

                          @dancer18 I already shared my batch scripts, feel free to use them ☛ https://forum.vivaldi.net/topic/10592/patching-vivaldi-with-batch-scripts/72
                          You just have to change the path to the modding directory and use your own username.

                          github ◊ vfm

                          ?
                          Dancer18
                          D
                          2 Replies Last reply
                          Reply Quote 2
                          • ?
                            A Former User @luetage
                            last edited by

                            @luetage said in How to prevent overwriting browser.html on update?:

                            use your own username.

                            or create a vivmod group

                            1 Reply Last reply Reply Quote 1
                            • Dancer18
                              D
                              Dancer18 @luetage
                              last edited by

                              @luetage Thank you! I thought you provided that somewhere but I couldn't find it.

                              However, something went wrong. I created a file Vivaldi-snapshot-batch.sh, made it executable and clicked on it - without an effect.

                              Might be a false code-line? My custom.js is in the same directory as browser.html.

                              #!/bin/bash
                              snapshot=/opt/vivaldi-snapshot/resources/vivaldi
                              moddir=/opt/vivaldi-snapshot/resources/vivaldi
                              sudo cp $moddir/custom.js $snapshot
                              sudo sed -i -e 's/<\/body>/  <script src="uimod.js"><\/script>\n  <\/body>/' "$snapshot/browser.html"
                              sudo chgrp rainer $snapshot/custom.js
                              sudo chmod g+rw $snapshot/custom.js
                              echo "vivaldi patched"
                              

                              Vivaldi with mail-client and calendar
                              OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                              hlehyaric
                              H
                              ?
                              2 Replies Last reply
                              Reply Quote 0
                              • hlehyaric
                                H
                                hlehyaric @Dancer18
                                last edited by

                                @dancer18 I think you should put your custom.js file outside V application.

                                Dancer18
                                D
                                1 Reply Last reply
                                Reply Quote 1
                                • ?
                                  A Former User @Dancer18
                                  last edited by

                                  @dancer18 firstly, there’s some probability of you losing the js due to using that location, though it ain’t high. secondly, if you wanna keep it there, you should only need the browser.html-patching line (+ the variable).

                                  1 Reply Last reply Reply Quote 0
                                  • Dancer18
                                    D
                                    Dancer18 @hlehyaric
                                    last edited by Dancer18

                                    @hlehyaric Maybe. However, up to now that file remains there when updating Snapshot (or Stable).

                                    Using the code and filling in the changed path it still doesn't work:

                                    #!/bin/bash
                                    snapshot=/opt/vivaldi-snapshot/resources/vivaldi
                                    moddir=$HOME/rainer
                                    sudo cp $moddir/custom.js $snapshot
                                    sudo cp $moddir/Page_Action.js $snapshot/user_files
                                    sudo sed -i -e 's/<\/body>/  <script src="uimod.js"><\/script>\n  <\/body>/' "$snapshot/browser.html"
                                    sudo chgrp username $snapshot/custom.js
                                    sudo chmod g+rw $snapshot/custom.js
                                    echo "vivaldi patched"
                                    

                                    Is the 3rd line correct? I put the custom.jsfile directly into my home directory.

                                    Vivaldi with mail-client and calendar
                                    OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                                    ?
                                    1 Reply Last reply
                                    Reply Quote 0
                                    • ?
                                      A Former User @Dancer18
                                      last edited by

                                      @dancer18 do you know what $HOME is when the script is run? you most likely want /home/rainer.

                                      Dancer18
                                      D
                                      1 Reply Last reply
                                      Reply Quote 0
                                      • Dancer18
                                        D
                                        Dancer18 @A Former User
                                        last edited by

                                        @potmeklecbohdan no I don't. And yes: I want /home/rainer.
                                        So just ignore $HOME?

                                        To avoid any further mistakes please give me the right code. 😉

                                        Vivaldi with mail-client and calendar
                                        OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                                        ?
                                        luetage
                                        L
                                        2 Replies Last reply
                                        Reply Quote 0
                                        • ?
                                          A Former User @Dancer18
                                          last edited by

                                          @dancer18 does a hand-written attempt on a diff suffice?

                                          - moddir=$HOME/rainer
                                          + moddir=/home/rainer
                                          

                                          also, i don’t know if this is the right code, i can just fix the mistake that i see atm.

                                          Dancer18
                                          D
                                          1 Reply Last reply
                                          Reply Quote 0
                                          • Dancer18
                                            D
                                            Dancer18 @A Former User
                                            last edited by

                                            @potmeklecbohdan Doesn't work either.

                                            Vivaldi with mail-client and calendar
                                            OS: Linux Mint LMDE 6 Cinnamon; Win10, GrapheneOS with Android 15

                                            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
                                            • 1 / 2
                                            • 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