Hi!
I wanto to quickly run my custom code to to manipulate tabs. I don’t want to go through process of writing my own addon, packing it, installing it and so on. Is it possible?
I see that under Tools > Browser Tools > Browser Toolbox there is a separate devtools that seems to have power over entire browser instead of just 1 page. Can I use this to access tabs for example? I mean I can use there $$(“tab”)[3].click() 4th tab for example but is there way to use some official API? For example this one? https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs ? According to this there should be browser.tabs but this console says it is undefined.
For example what do I need to write in this console if I want to iterate over tabs one by one and for each tab 1) refresh tab, and 2) sleep 1 sec, and then loop with next item?
For testing I tried to just refresh 1 tab to see if it works by typing
$$(“tab”)[3].dispatchEvent(new KeyboardEvent(‘keydown’, {‘key’: ‘F5’}));
In this Browser toolbox console but it did not seem to work, it just printed true to console and that was all. At the end of day it does not matter so much to me if I can access official API or if I can hack it somehow like with $$(“tab”) just any solution that works is ok as I never plan to write addon out of this code, just plan to store some quick code snippets in notepad where I can copy them and paste into firefox to get come stuff done. With Tabs API it would look nicer of course I care more about just getting it to work. In case I cant access tabs API from there, how do I have modifier keys? For example F5 is not guaranteed to refresh from server so if possible I would prefer to send ctrl + f5 to my tab instead of just f5.