-
Notifications
You must be signed in to change notification settings - Fork 343
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
Re-opening tab developer console after addon reload (brainstorming) #2965
Comments
If you are only modifying the extension page and not manifest.json, then you can achieve the desired effect by passing This will start Firefox with the extension installed (directly pointing to the source directory), and not auto-reload. When you reload the page, it will read the content from the disk. An alternative (without sacrificing the auto-reload option) is to do something like this (manual or automated):
|
Whoa, those are some seriously good looking out of box ideas! But the second idea is just amazing! But is it possible to automate it? |
I've been looking at the source code here and although I did find where the reloading happens, I have no idea how to fetch existing tabs. Is that even possible? PS: any plans to switch to TypeScript? It greatly helps with development. I could help with that, we could have a long pair-programming online session and migrate all code here in a several hours :). In TypeScript, most types is inferred so most of the code doesn't need any change. |
Yes it is! The "listTabs" request does what you want. Details below.
High-level documentation is at https://firefox-source-docs.mozilla.org/devtools/backend/protocol.html I found the goForward, goBack and navigateTo methods in a part of the protocol spec at https://searchfox.org/mozilla-central/rev/9c509b8feb28c1e76ad41e65bf9fd87ef672b00f/devtools/shared/specs/targets/window-global.js#50-53,62-69,79-84
We used to use Flow for typing before, but removed it in #2765 because its presence was interfering rather than helping with maintainability. There has also been a request to export TypeScript definitions, but we closed these because of concerns about long-term correctness and maintenance: #2829 (comment) . Migrating everything to TypeScript could reduce that concern, but I don't know if that's something that we want to do given our experience with Flow types here. |
Firefox has some projects build with TypeScript, maybe you ask them how they feel about it. But in general, based on StackOverflow survey, TypeScript is one of the most loved languages, more than JavaScript and way more than Flow: In any case, I'm trying to develop locally the web-ext based on the docs on my Windows but I'm having hard time :(
|
…ed (including dev console!): mozilla#2965
Is this a feature request or a bug?
Feature / discussion
What is the current behavior?
If you are developing an addon page, you quickly notice that your tab is closed each time
web-ext
reloads your addon.You may hotfix it by adding
await browser.tabs.create({url: 'options.html'})
into your background script, but that won't re-open developer console in that tab.What is the expected or desired behavior?
I want the developer console to be opened after the reload.
I would like to brainstorm possible solutions for this problem.
For example:
prevent closing tab when the addon is reloaded - I guess Firefox would have to implement something (which would actually fixed the issue with "pinned addon page disappearing after addon update")
web-ext
could maybe open dev-tools if it has permission for that (I'm not sure how the integration with Firefox works and what are the capabilities). Also the question is, how to configure it... maybe new parameter "on-reload-dev-url=options.html"?The text was updated successfully, but these errors were encountered: