Opened 2 years ago

Last modified 14 months ago

#5938 closed defect

webextension: "block element" does not appear in menu for FB — at Version 11

Reported by: mapx Assignee:
Priority: P2 Milestone: Adblock-Plus-3.5-for-Chrome-Opera-Firefox
Module: Platform Keywords: externaldependencies
Cc: mjethani, kzar, sebastian, hfiguiere, Ross, cjsmall, greiner Blocked By:
Blocking: Platform: Firefox
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

Description (last modified by kzar)


FF 57
easylist / easyprivacy

How to reproduce

go to facebook
click ABP icon

Observed behaviour

"block element" entry missing

Expected behaviour

"block element" entry available


  • An error shows up in the background console when the popup is opened, but only when the problem is happening:
Unchecked lastError value: Error: ext is not defined  ExtensionCommon.jsm:304
	withLastError resource://gre/modules/ExtensionCommon.jsm:304:9
	wrapPromise/< resource://gre/modules/ExtensionCommon.jsm:357:11
  • This does not seem to be a recent regression, I tested quite far back and could consistently reproduce the problem.
  • I can still reproduce the problem with EasyList disabled, which I found surprising.
  • I can't reproduce the problem on other sites, for example

Change History (11)

comment:1 Changed 2 years ago by mapx

  • Component changed from Unknown to Platform

comment:2 Changed 2 years ago by mapx

  • Description modified (diff)

comment:3 Changed 2 years ago by kzar

  • Cc hfiguiere Ross added
  • Platform changed from Unknown / Cross platform to Firefox

comment:4 Changed 2 years ago by kzar

  • Priority changed from Unknown to P2
  • Ready set

I can reproduce this as described, investigating.

comment:5 Changed 2 years ago by kzar

  • Description modified (diff)

comment:6 follow-up: Changed 2 years ago by mapx

Could be related to this ticket ?

Does FB use some restrictive CSP directives ?

comment:7 Changed 2 years ago by kzar

  • Description modified (diff)

comment:8 in reply to: ↑ 6 Changed 2 years ago by kzar

Replying to mapx:

Could be related to this ticket ?

Does FB use some restrictive CSP directives ?

Well since the error is showing up in the background page I figure it's not likely to be the problem, but for reference the CSP I'm seeing is default-src * data: blob:;script-src * * * * * ** ** 'unsafe-inline' 'unsafe-eval' * blob: data: 'self';style-src data: blob: 'unsafe-inline' *;connect-src * * * ** * wss://*** * ws://localhost:* blob: * 'self';

comment:9 Changed 2 years ago by kzar

I'm not sure what's going on here, popup.js is sending "composer.content.getState" but getting undefined as the response. I've ran out of time for today.

comment:10 Changed 2 years ago by mjethani

Well, I've narrowed it down. The problem here is that ext in ext/content.js is undefined. But that's only the symptom of the real problem, which is a bug in Firefox.

You can try out the simple extension below.

Here's the manifest.json:

  "applications": {
    "gecko": {
      "id": "",
      "strict_min_version": "50.0"
  "content_scripts": [
      "js": ["content.js"],
      "matches": [ "http://*/*", "https://*/*" ],
      "run_at": "document_start"
  "description": "An example extension",
  "manifest_version": 2,
  "name": "Example",
  "short_name": "Example",
  "version": "0.1.0"

And here's the content.js:

  const instanceId = Math.floor(Math.random() * 10000);

  console.log("Initializing content.js");
  let printFoo = () => console.log(`[${instanceId}]`,; = {};
  setInterval(printFoo, 1000);
  console.log("Finished initializing content.js");

Now when you load you'll see that even though is assigned and prints the correct value immediately, on the first tick (after a second) it prints undefined and keeps printing undefined forever. It's like the window object is getting replaced at some point.

Interestingly this does not happen on

I'll investigate further tomorrow but this looks like a bug.

Last edited 2 years ago by mjethani (previous) (diff)

comment:11 Changed 2 years ago by mjethani

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing
Note: See TracTickets for help on using tickets.