Unreliable loading of webExtension due to asynchronous nature

RESOLVED DUPLICATE of bug 1378459

Status

()

Toolkit
WebExtensions: General
RESOLVED DUPLICATE of bug 1378459
4 months ago
2 months ago

People

(Reporter: badkins79, Unassigned)

Tracking

55 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 months ago
User Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36

Steps to reproduce:

I am porting a security-related extension from Chrome to a Firefox webExtension. Everything works, but the initial loading of the extension is unreliable. The whole purpose of the extension is to block access to potentially malicious web content, and it does this primarily with the webRequest API. 


Actual results:

The problem is that when Firefox first starts, and then loads my webExtension, it may be too late. I have seen 3 possible cases:
1. My webExtension loads before the first tab is created. Everything functions as desired in this case.
2. My webExtension loads after the first tabs have been created, but before any of them have issued any webRequests. Everything functions as desired in this case as well.
3. My webExtension loads after tabs have been created and have already sent off webRequests. This is the problem, because this could have been to a site that my users are expecting my webExtension to protect them from.

I have tried everything I can think of to stop the requests from #3, but nothing works.


Expected results:

Firefox should load webExtensions in a reliable manner. If a user has chosen to use a webExtension whose purpose is to block the loading of certain web content, Firefox should facilitate that. 

If Firefox can reliably load the webExtensions in either case #1 or #2 then this would provide reliability and not expose users to threats.

Note that I also have a legacy Firefox extension that performs this same function, and it works perfectly, because it is loaded reliably. The unreliable behavior of the webExtensions looks like a regression in comparison.
(Reporter)

Updated

4 months ago
OS: Unspecified → All
Hardware: Unspecified → All

Comment 1

4 months ago
@badkins79,
Could you attach your webExtension(minimal) for reproduce the issue ?
Flags: needinfo?(badkins79)

Updated

4 months ago
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1378459

Updated

2 months ago
Flags: needinfo?(badkins79)
You need to log in before you can comment on or make changes to this bug.