- Code: Select all
browser.runtime.sendMessage()
and
- Code: Select all
browser.tabs.create(
from Browser Console?
The thing is: how to access browser object?
Accessing WebExtensions world from chrome
5 posts
• Page 1 of 1
For instance, how to run
and
from Browser Console? The thing is: how to access browser object? A few years ago, I tried to create the browser object in the browser console. I couldn't figure out how to run code like "class extends ExtensionAPI" in the browser console.
browser.runtime http://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime http://searchfox.org/mozilla-release/source/toolkit/components/extensions/parent/ext-runtime.js http://searchfox.org/mozilla-release/source/toolkit/components/extensions/child/ext-runtime.js browser.tabs http://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/tabs http://searchfox.org/mozilla-release/source/browser/components/extensions/parent/ext-tabs.js http://searchfox.org/mozilla-release/source/browser/components/extensions/child/ext-tabs.js Try using the console in the about:debugging page. * open about:debugging * left click This Firefox on the left side * left click inspect button next to an extension * copy and paste code into the console * press enter to run
Debugging http://developer.mozilla.org/Add-ons/WebExtensions/Debugging - Open Browser Toolbox (Ctrl+Alt+Shift+I);
- On upper right, click and select extensions/content/dummy Each browser in there is one WebExtension. So, for example:
I got a code snippet working in the browser console in Firefox.
uBlock Origin (declares tabs permission in manifest.json) http://addons.mozilla.org/firefox/addon/607454 ... I got a code snippet working in the error console in Thunderbird.
XNote++ (declares tabs permission in manifest.json) http://addons.thunderbird.net/thunderbird/addon/64758 Last edited by morat on November 12th, 2020, 4:10 pm, edited 1 time in total.
Great. I'll observe 'chrome-document-global-created' in userChromeJS (autoconfig.js) as it runs earlier than extensions, so I can access WebExtensions from the very beggining.
5 posts
• Page 1 of 1
Return to Extension Development Who is onlineUsers browsing this forum: No registered users and 1 guest |
![]() |