Closed Bug 1383470 Opened 7 years ago Closed 7 years ago

Unreliable loading of webExtension due to asynchronous nature

Categories

(WebExtensions :: General, defect)

55 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1378459

People

(Reporter: badkins79, Unassigned)

Details

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.
OS: Unspecified → All
Hardware: Unspecified → All
@badkins79,
Could you attach your webExtension(minimal) for reproduce the issue ?
Flags: needinfo?(badkins79)
Component: Untriaged → WebExtensions: General
Product: Firefox → Toolkit
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(badkins79)
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.