Add API to clear registered proxy script

RESOLVED FIXED in Firefox 56

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
2 months ago
10 days ago

People

(Reporter: 61.1p57, Assigned: mattw, NeedInfo)

Tracking

({dev-doc-needed})

unspecified
mozilla56
dev-doc-needed
Points:
---

Firefox Tracking Flags

(firefox56 fixed)

Details

(Whiteboard: [proxy] investigating)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 months ago
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:54.0) Gecko/20100101 Firefox/54.0
Build ID: 20170605134926

Steps to reproduce:

The proxy support in Firefox is different from Chrome, and there is currently no functionally equivalent API for chrome.proxy.settings.clear

https://developer.chrome.com/extensions/proxy#method-settings-clear
(Assignee)

Updated

2 months ago
Flags: needinfo?(mwein)

Updated

2 months ago
Whiteboard: investigating

Updated

2 months ago
Whiteboard: investigating → [proxy] investigating
(Assignee)

Updated

2 months ago
Duplicate of this bug: 1376204
(Assignee)

Updated

2 months ago
Assignee: nobody → mwein
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(mwein)

Comment 2

2 months ago
I have made the following edits to 'proxy.json' & 'ext-proxy.js'
They include suggestions and function name changes but they are only suggestion.

proxy.json
https://pastebin.mozilla.org/9025785

ext-proxy.js
https://pastebin.mozilla.org/9025786

Comment 3

2 months ago
Here are the same as above with register & unregister as function names


https://pastebin.mozilla.org/9025799
https://pastebin.mozilla.org/9025800
Comment hidden (mozreview-request)
(Assignee)

Comment 5

2 months ago
Erosman, thank you for the contribution!

Comment 6

2 months ago
ref: review board API name change

While you are at it, you might as well consider proxy.onProxyError changing/aliasing to proxy.onError/onerror

proxy.register
proxy.unregister
proxy.onerror (for better harmony with other APIs)

eg:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/onerror
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequestEventTarget/onerror

Comment 7

2 months ago
mozreview-review
Comment on attachment 8881197 [details]
Bug 1371879 - Add support for unregistering proxy scripts

https://reviewboard.mozilla.org/r/152464/#review157714
Attachment #8881197 - Flags: review?(mixedpuppy) → review+

Comment 8

2 months ago
Pushed by mwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11962cdf2078
Add support for unregistering proxy scripts r=mixedpuppy

Comment 9

2 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/11962cdf2078
Status: ASSIGNED → RESOLVED
Last Resolved: 2 months ago
status-firefox56: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56

Comment 10

2 months ago
What happened to proxy.onerror?!
(Assignee)

Comment 11

2 months ago
Sorry for not explaining - I'd okay with renaming to onError, but I'd rather make than change in a separate bug.

Comment 12

2 months ago
I realise that this bug is closed but I didnt want to open a new bug (unless it is needed).

I am unsure about how the API is implemented.

Looking at the following example:
https://github.com/mdn/webextensions-examples/tree/master/proxy-blocker


- It seems 'proxy-script.js' is initiated at browser start. Is it cached?
It makes sense to cache the proxy script, but then ...

- New preferences are sent to 'proxy-script.js' via 'runtime.onMessage'
What happens then?
If the 'proxy-script.js' is cached, how would it affect the change?
Does the 'proxy-script.js' automatically unregistered and registers every time new data is sent via 'runtime.onMessage'?
What happens to the new preference data passed to 'proxy-script.js' once 'proxy-script.js' is unloaded/unregistered?


With the addition of the unregister, developers can now manually stop and restart the 'proxy-script.js' every time they need to update the rules.

How would the API work in FF55? (since unrgister is due for FF56)

Updated

a month ago
Keywords: dev-doc-needed
I've updated the docs for the addition of unregister() and the rename of registerProxyScript() to just register():

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy/register
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/proxy/unregister

Please let me now if this covers it!
Flags: needinfo?(matthewjwein)

Comment 14

14 days ago
re: comment 10-11
Was proxy.onError ever filed?
> Was proxy.onError ever filed?

Not to my knowledge. Please do so if you want that change.

Comment 16

10 days ago
Filed: Bug 1388619
You need to log in before you can comment on or make changes to this bug.