-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting proxy for new tab in Firefox #157
Comments
This is limited because browser-extension/src/content/on-request.js Lines 223 to 229 in e5a035e
This also makes it impossible to set tab proxy for a page that failed to load in new tab because it's only available through proxy, one of these scenarios:
or:
In both cases, until page is loaded to some extent, I tried to bypass that check in lines 225-229, it works, at least in Firefox and fixes described scenarios. Maybe it's safe to remove such check (remove whole |
Try this and see how it works switch (true) {
case !/^(https?:\/\/.+|about:newtab)$/.test(tab.url): // unacceptable URLs
case this.bypass(tab.url): // check local & global passthrough
return;
} |
When I enable proxy with some url opened and then press home button and it opens new tab in current tab, proxy is still enabled and I can open another url with proxy already enabled. |
Tried, it works, but in latest release ( On So, this change worked for me: diff --git a/src/content/on-request.js b/src/content/on-request.js
index 2c5922f..a131db0 100644
--- a/src/content/on-request.js
+++ b/src/content/on-request.js
@@ -228,7 +228,7 @@ export class OnRequest {
static async setTabProxy(pxy) {
const [tab] = await browser.tabs.query({currentWindow: true, active: true});
switch (true) {
- case !/https?:\/\/.+/.test(tab.url): // unacceptable URLs
+ case !/^(https?:\/\/.+|about:newtab|about:blank)$/.test(tab.url): // unacceptable URLs
case this.bypass(tab.url): // check local & global passthrough
return;
} Also tried it in Chrome, but seems that "set tab proxy" is not possible / not implemented in Chrome. I don't have Android devices to test Android Firefox extension. |
Found out that in diff --git a/src/content/on-request.js b/src/content/on-request.js
index d327f02..1f4853a 100644
--- a/src/content/on-request.js
+++ b/src/content/on-request.js
@@ -223,8 +223,8 @@ export class OnRequest {
static setTabProxy(tab, pxy) {
// const [tab] = await browser.tabs.query({currentWindow: true, active: true});
switch (true) {
- case !/https?:\/\/.+/.test(tab.url): // unacceptable URLs
- case this.bypass(tab.url): // check local & global passthrough
+ case !/https?:\/\/.+|about:blank|about:newtab/.test(tab.url): // unacceptable URLs
+ case this.bypass(tab.url): // check local & global passthrough
return;
}
diff --git a/src/content/popup.js b/src/content/popup.js
index 893e851..0ea0fbc 100644
--- a/src/content/popup.js
+++ b/src/content/popup.js
@@ -104,7 +104,7 @@ class Popup {
static async checkTabProxy() {
const [tab] = await browser.tabs.query({currentWindow: true, active: true});
- if (!/https?:\/\/.+/.test(tab.url)) { return; } // unacceptable URLs
+ if (!/https?:\/\/.+|about:blank|about:newtab/.test(tab.url)) { return; } // unacceptable URLs
this.tab = tab; // cache tab
const item = await browser.runtime.sendMessage({id: 'getTabProxy'}); |
It is done for v8.10 |
Please make it able to set proxy for new tab in Firefox. Currently I can't set proxy for new tab, I need to go to any website to do it (if I don't want someone to know I am visiting this website, I need to go to another website (e.g. google.com), then set proxy, then go to the target website).
The text was updated successfully, but these errors were encountered: