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

Add Firefox support to the browser extension #235

Closed
wKovacs64 opened this issue Jul 1, 2020 · 13 comments
Closed

Add Firefox support to the browser extension #235

wKovacs64 opened this issue Jul 1, 2020 · 13 comments
Labels
feature New feature or request firefox extension

Comments

@wKovacs64
Copy link

Summary 💡

It would be great if the extension worked in Firefox as it does in Chrome.

Examples 🌈

See Chrome behavior.

Motivation 🔦

Not everyone uses Chrome. 🙂

Additional Information ℹ️

I don't know anything about browser extensions, so take this with a grain of salt.

I glanced around and it sounds like most extensions should work in both browsers (perhaps with a little tweaking). I ran the Testing Playground extension through https://www.extensiontest.com/ and it had no errors or compatibility problems, just a couple warnings (raw results are available at the bottom of this issue). Hoping it would Just Work™️, I temporarily installed a local copy in Firefox. This revealed a couple different warnings:

  • Reading manifest: Warning processing background.persistent: Event pages are not currently supported. This will run as a persistent background page.
  • Reading manifest: Warning processing version_name: An unexpected property was found in the WebExtension manifest.

image

While it does load, it doesn't seem to do anything. It just looks like this:

image

Clicking the "select element" button does highlight things and feels like it's allowing me to select an element, but once I click on an element, nothing changes in the dev tools panel.

Thanks for considering this request!

ExtensionTest.com Results
{
  "compat": [],
  "errors": [],
  "warnings": [
    {
      "message": "Using 'eval' has strong security and performance implications.",
      "description": "In most cases the same result can be achieved differently, therefore it is generally prohibited",
      "locations": [
        {
          "file": "manifest.json"
        }
      ]
    },
    {
      "message": "The Function constructor is eval.",
      "description": "Evaluation of strings as code can lead to security vulnerabilities and performance issues, even in the most innocuous of circumstances. Please avoid using `eval` and the `Function` constructor when at all possible.'",
      "locations": [
        {
          "file": "window/testing-library.js",
          "line": 90
        },
        {
          "file": "window/testing-library.js",
          "line": 90
        },
        {
          "file": "content-script/contentScript.js",
          "line": 1
        },
        {
          "file": "content-script/contentScript.js",
          "line": 90
        },
        {
          "file": "content-script/contentScript.js",
          "line": 90
        },
        {
          "file": "devtools/pane.js",
          "line": 1
        },
        {
          "file": "devtools/pane.js",
          "line": 90
        },
        {
          "file": "devtools/panel.js",
          "line": 1
        },
        {
          "file": "devtools/panel.js",
          "line": 90
        },
        {
          "file": "devtools/panel.js",
          "line": 90
        }
      ]
    },
    {
      "message": "Unsafe assignment to innerHTML",
      "description": "Due to both security and performance concerns, this may not be set using dynamic values which have not been adequately sanitized. This can lead to security issues or fairly serious performance degradation.",
      "locations": [
        {
          "file": "content-script/contentScript.js",
          "line": 90
        },
        {
          "file": "content-script/contentScript.js",
          "line": 90
        },
        {
          "file": "content-script/contentScript.js",
          "line": 90
        },
        {
          "file": "devtools/pane.js",
          "line": 1
        },
        {
          "file": "devtools/pane.js",
          "line": 1
        },
        {
          "file": "devtools/panel.js",
          "line": 1
        },
        {
          "file": "devtools/panel.js",
          "line": 1
        }
      ]
    }
  ]
}
@wKovacs64 wKovacs64 added the feature New feature or request label Jul 1, 2020
@smeijer
Copy link
Member

smeijer commented Jul 1, 2020

I've taken a look at it, and the warnings that you're seeing are easily fixable.

Unfortunately, it seems that crx-bridge, does not yet support Firefox: zikaari/crx-bridge#4.

So, for now this doesn't feel like an easy task. Unless we can contribute to crx-bridge to add Firefox support there as well.

But I do definitely agree. Support for Firefox would be nice. And as Edge now starts to look so much like Chrome, I believe that one should be easy to support as well.

@wKovacs64
Copy link
Author

Sounds like the crx-bridge author is interested! Thanks for taking a look.

@smeijer
Copy link
Member

smeijer commented Jul 2, 2020

I'll keep an eye on that one 😇

@smeijer
Copy link
Member

smeijer commented Oct 21, 2020

crx-bridge has been updated, so this should now be possible.

@balavishnuvj
Copy link
Contributor

@smeijer need any help here?

@marcosvega91
Copy link
Member

crx-bridge Has been updated with Firefox support. Here we have the version 2.1 But we should install the version 3. Do you wanna open a PR with the package update? It will be very awesome 😎

@balavishnuvj
Copy link
Contributor

image

just after updating crx-bridge to 3.0.1 I'm getting these errors. Before digging deep into these, thought will run by you guys once.

@smeijer
Copy link
Member

smeijer commented Dec 6, 2020

@smeijer need any help here?

@balavishnuvj Would be much appreciated!

@WeslleyNasRocha
Copy link
Contributor

I used web-ext to "run" the extension and it gave any errors, can you guys try it? #327

@joaopedrodcf
Copy link

As #327 was successfully merged and accepted in firefox addons we can close this no? @smeijer 🙏

@smeijer
Copy link
Member

smeijer commented Feb 16, 2021

We can indeed. 😎

@smeijer smeijer closed this as completed Feb 16, 2021
@smeijer
Copy link
Member

smeijer commented Feb 16, 2021

I did notice a bug tho. The side panel in the elements pane does not seem to work in Firefox. Maybe that upgrading crx-bridge will fix that.

@WeslleyNasRocha
Copy link
Contributor

Wow, in fact, I've never used that panel hahaha, only the dedicated panel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request firefox extension
Projects
None yet
Development

No branches or pull requests

6 participants