Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snowflake
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
trinity-1686a
Snowflake
Commits
685c3bd2
Commit
685c3bd2
authored
Sep 26, 2019
by
Arlo Breault
Browse files
Options
Downloads
Patches
Plain Diff
Disable the webext if the bridge is unreachable
parent
19bc6d88
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
proxy/init-webext.js
+26
-8
26 additions, 8 deletions
proxy/init-webext.js
proxy/static/_locales/en_US/messages.json
+3
-0
3 additions, 0 deletions
proxy/static/_locales/en_US/messages.json
with
29 additions
and
8 deletions
proxy/init-webext.js
+
26
−
8
View file @
685c3bd2
...
@@ -31,6 +31,20 @@ class WebExtUI extends UI {
...
@@ -31,6 +31,20 @@ class WebExtUI extends UI {
this
.
setEnabled
(
false
);
this
.
setEnabled
(
false
);
return
;
return
;
}
}
(
new
Promise
((
resolve
,
reject
)
=>
{
const
ws
=
WS
.
makeWebsocket
(
config
.
relayAddr
);
ws
.
onopen
=
()
=>
{
resolve
();
ws
.
close
();
};
ws
.
onerror
=
()
=>
{
this
.
missingFeature
=
'
popupBridgeUnreachable
'
;
this
.
setEnabled
(
false
);
reject
(
'
Could not connect to bridge.
'
);
ws
.
close
();
};
}))
.
then
(()
=>
{
chrome
.
storage
.
local
.
get
(
"
snowflake-enabled
"
,
(
result
)
=>
{
chrome
.
storage
.
local
.
get
(
"
snowflake-enabled
"
,
(
result
)
=>
{
let
enabled
=
this
.
enabled
;
let
enabled
=
this
.
enabled
;
if
(
result
[
'
snowflake-enabled
'
]
!==
void
0
)
{
if
(
result
[
'
snowflake-enabled
'
]
!==
void
0
)
{
...
@@ -40,6 +54,10 @@ class WebExtUI extends UI {
...
@@ -40,6 +54,10 @@ class WebExtUI extends UI {
}
}
this
.
setEnabled
(
enabled
);
this
.
setEnabled
(
enabled
);
});
});
})
.
catch
((
e
)
=>
{
log
(
e
);
});
}
}
postActive
()
{
postActive
()
{
...
...
This diff is collapsed.
Click to expand it.
proxy/static/_locales/en_US/messages.json
+
3
−
0
View file @
685c3bd2
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
"popupWebRTCOff"
:
{
"popupWebRTCOff"
:
{
"message"
:
"WebRTC feature is not detected."
"message"
:
"WebRTC feature is not detected."
},
},
"popupBridgeUnreachable"
:
{
"message"
:
"Could not connect to the bridge."
},
"popupDescOn"
:
{
"popupDescOn"
:
{
"message"
:
"Number of users your Snowflake has helped circumvent censorship in the last 24 hours: $1"
"message"
:
"Number of users your Snowflake has helped circumvent censorship in the last 24 hours: $1"
},
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment