Page 1 of 1

[Invalid] NS Classic causes ServiceWorker-related WebExtension content script to crash the tab

Posted: Sun Mar 03, 2019 6:54 pm
by barbaz
Waterfox 56.2.7.1 (Linux x86_64)
NoScript 5.1.9rc1
new profile

STR:

1) install NoScript

2) install this test WebExtension -

manifest.json

Code: Select all

{
  "manifest_version": 2,
  "name": "ServiceWorker content script test",
  "version": "1",
  "author":"barbaz",

  "permissions": [
    "<all_urls>"
  ],

  "content_scripts": [
    {
      "js": ["content.js"],
      "matches": ["<all_urls>"],
      "run_at": "document_idle",
      "all_frames": true,
      "match_about_blank": true
    }
  ],

  "applications": {
    "gecko": {
      "id": "{e3a8bcb2-637c-4b77-a7c6-89be91615514}"
    }
  }
}
content.js

Code: Select all

if (navigator.serviceWorker) {
  navigator.serviceWorker.ready.then((reg) => {
    alert('A ServiceWorker is ready.');
  });
}
3) visit a page that registers a ServiceWorker (I used a test page on my local server)

Expected results: alert box

Actual results: Waterfox says "Gah. Your tab just crashed."

Firefox 56.0.2 works as expected, no tab crash. Is this a NoScript issue or a Waterfox issue?

Re: NS Classic causes ServiceWorker-related WebExtension content script to crash the tab

Posted: Sun Mar 03, 2019 7:39 pm
by barbaz
Well, this is really odd. In my custom builds of Waterfox, 56.0.3 has no issue here, while 56.0.4.1 crashes. But the official Waterfox builds are crashing at least as far back as 56.0.1.

I don't remember what local Waterfox patches I had at that time, if any. But I'm sure they would have been completely unrelated to this.

Image

Re: NS Classic causes ServiceWorker-related WebExtension content script to crash the tab

Posted: Sun Mar 03, 2019 7:43 pm
by barbaz
Hmm.

Custom Waterfox 56.0.3 was compiled with gcc 6.3.1 (rh-devtoolset-6)
Custom Waterfox 56.0.4.1 was compiled with clang 3.9.1 (this is more like the official Waterfox builds)

Could this be related? Maybe I need to try a build of 56.2.7.1 compiled with gcc??

(In case this is related, some additional info: my custom Waterfox 56.2.7.1 build was compiled with clang 5.0.1)

Re: NS Classic causes ServiceWorker-related WebExtension content script to crash the tab

Posted: Sun Mar 03, 2019 9:41 pm
by barbaz
barbaz wrote: Sun Mar 03, 2019 7:43 pm Maybe I need to try a build of 56.2.7.1 compiled with gcc??
Bingo. Waterfox 56.2.7.1 compiled with gcc 7.3.0 does not crash.

So I guess this is not a NoScript issue. Sorry about this.

Cross reference

Posted: Sun Mar 03, 2019 11:51 pm
by grahamperrin