Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
torbutton
Commits
5e3bc461
Commit
5e3bc461
authored
Apr 04, 2019
by
Georg Koppen
Browse files
Merge remote-tracking branch 'acat/22538+1'
parents
9d7c1081
7287a252
Changes
1
Show whitespace changes
Inline
Side-by-side
src/chrome/content/torbutton.js
View file @
5e3bc461
...
@@ -18,6 +18,7 @@ const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion"
...
@@ -18,6 +18,7 @@ const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion"
const
k_tb_browser_update_needed_pref
=
"
extensions.torbutton.updateNeeded
"
;
const
k_tb_browser_update_needed_pref
=
"
extensions.torbutton.updateNeeded
"
;
const
k_tb_last_update_check_pref
=
"
extensions.torbutton.lastUpdateCheck
"
;
const
k_tb_last_update_check_pref
=
"
extensions.torbutton.lastUpdateCheck
"
;
const
k_tb_tor_check_failed_topic
=
"
Torbutton:TorCheckFailed
"
;
const
k_tb_tor_check_failed_topic
=
"
Torbutton:TorCheckFailed
"
;
const
k_tb_about_uri_first_party_domain
=
"
about.ef2a7dd5-93bc-417f-a698-142c3116864f.mozilla
"
;
var
m_tb_prefs
=
Services
.
prefs
;
var
m_tb_prefs
=
Services
.
prefs
;
...
@@ -861,6 +862,22 @@ function torbutton_send_ctrl_cmd(command) {
...
@@ -861,6 +862,22 @@ function torbutton_send_ctrl_cmd(command) {
function
torbutton_new_circuit
()
{
function
torbutton_new_circuit
()
{
let
firstPartyDomain
=
gBrowser
.
contentPrincipal
.
originAttributes
let
firstPartyDomain
=
gBrowser
.
contentPrincipal
.
originAttributes
.
firstPartyDomain
;
.
firstPartyDomain
;
// Bug 22538: For neterror or certerror, get firstPartyDomain causing it from the u param
if
(
firstPartyDomain
===
k_tb_about_uri_first_party_domain
)
{
let
knownErrors
=
[
"
about:neterror
"
,
"
about:certerror
"
];
let
origin
=
gBrowser
.
contentPrincipal
.
origin
||
''
;
if
(
knownErrors
.
some
(
x
=>
origin
.
startsWith
(
x
)))
{
try
{
let
urlOrigin
=
new
URL
(
origin
);
let
{
hostname
}
=
new
URL
(
urlOrigin
.
searchParams
.
get
(
'
u
'
));
if
(
hostname
)
{
firstPartyDomain
=
Services
.
eTLD
.
getBaseDomainFromHost
(
hostname
)
||
firstPartyDomain
;
}
}
catch
(
e
)
{
torbutton_log
(
4
,
"
Exception on new circuit
"
+
e
);
}
}
}
let
domainIsolator
=
Cc
[
"
@torproject.org/domain-isolator;1
"
]
let
domainIsolator
=
Cc
[
"
@torproject.org/domain-isolator;1
"
]
.
getService
(
Ci
.
nsISupports
).
wrappedJSObject
;
.
getService
(
Ci
.
nsISupports
).
wrappedJSObject
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment