Theme internal pages
-
@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.