Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser is not defined in firefox #504

Closed
dumpster-of-things opened this issue Nov 15, 2022 · 3 comments
Closed

browser is not defined in firefox #504

dumpster-of-things opened this issue Nov 15, 2022 · 3 comments
Labels
idle Issues and pull requests with no activity for three months.

Comments

@dumpster-of-things
Copy link

#194

I have read discussion at the referenced issue, which has been marked "closed."
I do not see a solution for, nor explanation of why browser is undefined in firefox.

I am on version: 106.0.5 (64-bit) (Mozilla Firefox Snap for Ubuntu canonical-002 - 1.0)

My goal is to get a list of urls for open tabs.
I am following along with examples on MDN, running code verbatim in devtools>console.
The various related examples all use methods of the browser.tab construct.
There does not seem to be any documentation for broswer on MDN and so I am opening this issue.

I'm new to web development, but not to programming/scripting; and so
on the one hand: I'm probably missing something relatively pedestrian,
on the other hand: This seems like something too fundamental to not be documented;
and so perhaps this is an opportunity to make said documentation more complete.

@Rob--W
Copy link
Member

Rob--W commented Nov 15, 2022

The tabs documentation ( https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs ) is part of the documentation of APIs for WebExtensions. That includes tutorials to run extension code

Are you able to find answers to your questions at:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions

@dumpster-of-things
Copy link
Author

dumpster-of-things commented Nov 15, 2022

The (Tabs API) examples featured in the documentation you linked to use the following syntax:
browser.tab ...
But it never mentions how to set browser and there does not appear to be any documentation on MDN about the predicate browser variable.

Can the Tabs API be interacted with directly through the console, or will I need to author [and publish?] a browser extension?

@github-actions github-actions bot added the idle Issues and pull requests with no activity for three months. label Jan 4, 2023
@rebloor
Copy link
Collaborator

rebloor commented Jun 23, 2023

@dumpster-of-things I suspect your problem is that you need Toolbox for browser to be defined when you run snippets in the console. To do this, open about:debugging then This Firefox, click Inspect against any installed or temporary extension, and open Console. You can then paste and run the example code in the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idle Issues and pull requests with no activity for three months.
Projects
None yet
Development

No branches or pull requests

3 participants