Theme internal pages
-
@hlehyaric Fun fact: That extension was born as an experiment to theme only the non material design
vivaldi://extensions
as suggested by an other user -
-
@tam710562 said in Restore Methods for chrome.tabs:
Note: Be sure to launch this code before any other mods.
(me adding: any other mods that need it)
-
@potmeklecbohdan said in Theme internal pages:
@tam710562 said in Restore Methods for chrome.tabs:
Note: Be sure to launch this code before any other mods.
(me adding: any other mods that need it)
In my first try in snapshot I saw it too late. But in stable I launched his code before the new one of @luetage . Although there were 2 other js-scripts.
How fix that? I deleted the user script-entries in
browser.html
, restarted the browser, added the chrome.tabs - script again and later the other scripts.
But that didn't work obviously. -
@Dancer18 I only have a single javascript file and I just put the restore methods at the bottom. It will be read before any functions trigger and that’s good enough. Haven’t tested with a separate file. Maybe try just this mod with the restore methods and check whether it works. Also make sure to open the about page in a new tab. Another way to test is setting the new tab page to blank and and clicking the new tab button in the address bar.
-
@Hadden89 Only about and blank is implemented,
vivaldi://gpu/
is tested and it themes. It should theoretically work on any of the internal pages, but I’m not sure. -
@luetage Ok, done. And the test works! But it only works when I set the start-page and new tab options to either
about:blank
orvivaldi:about
.When I have my speeddial startpage and new tab and type in the 2 URLs, I get white background.
-
@Dancer18 As said, they have to open in a new tab. Press
shift‐
oralt-enter
(depending on your settings) to open an address in a new tab and it will work.And yeah, I just looked at the script again, the restore methods have to be in the same file, it won’t work otherwise. You can use a javascript minifier and simply put the one‐liner on bottom of every file in which one of the methods is in use.
-
@luetage I put all my 4 mod-js into 1
custom.js
. That works.
Why have we to pressalt-enter
to get the dark view? Will you change the code later to get it done withenter
? -
@Dancer18 I haven’t looked at a solution yet, but it would involve adding more listeners. Again: you just have to remember it has to open in a new tab, not in the same tab. I have my bookmarks set to open in a new tab by default. Quick commands bookmarks open in a new tab by default and menu entries will likewise open in a new tab. It just depends on your settings.
shift‐
oralt‐enter
just reverses your setting. Instead of opening in the same tab, it will open in a new tab and vice versa, has nothing to do with this mod, it’s just inbuilt Vivaldi functionality. -
@luetage said in Theme internal pages:
I have my bookmarks set to open in a new tab by default.
Me too. Yes, via bookmarks it's just fine for me.
-
@Dancer18 The strange thing is we are listening on an update of the URL, therefore it should work in the same tab and this approach does indeed work in both the theme and search backup mods. I’m doing something folly probs. I just tried listening for a change of the tab title additionally and this works and will trigger on the about page in the same tab. Gonna update OP.
-
@luetage I don't understand why but
changeinfo
only returns{ exttdata: string }
so there is no information to run CSS. I changed it totab
, it was running but there were a few errors. -
@tam710562 Try
console.log(changeInfo.url);
. The changeInfo returns an array, one of the items is the url, another the tab title, another is info on whether the tab is muted, &c. The listener triggers correctly on every URL change, but the CSS is only inserted when this happens on a new tab or window. The title change triggers correctly too and for the about page it works in the same tab, the blank page throws an error though. -
@luetage I understood the reason why it didn't run the CSS when I reload the page. This condition
changeinfo.title === 'About Version'
isn't true for me because I don't use the English -
@guigirl Needs to be at bottom like your other custom scripts. I have never tried putting a script on top, but the guide explicitly mentions to put them last. All of them should be beneath
bundle.js
. -
@guigirl Yes, that’s a misunderstanding. The restore tabs methods script needs to load before any functions using it. Putting it at the bottom of the internal pages script is enough, but it has to be in the same file.
-
<body> <div id="app" /> <script src="background-common-bundle.js"></script> <script src="vendor-bundle.js"></script> <script src="settings-bundle.js"></script> <script src="urlbar-bundle.js"></script> <script src="components-bundle.js"></script> <script src="bundle.js"></script> <script src="jdhooks.js"></script> <script src="advancedPanels.js"></script> <script src="theme-internal-pages.js"></script> <script src="custom.js"></script> </body>
-
@guigirl Only advise I can give is using console logs to find out whether the script triggers. “This doesn’t work” won’t get you anywhere.
I know this is harder than a usual script, since I didn’t post all the code needed to make it work, but the restore tabs method could change and it should be fully under tam710562’s control.
-
@guigirl Fair point, only shows it’s important to follow guides. But this is only valid for the hooks mod, everything else belongs beneath
bundle.js
. In any case, you should always test mods without any other mods running to find out whether they work for you. You cannot expect that all mods play nice together and it is impossible for a third person to determine what you should do to make everything work together without having access to your full code.