Skip to content

Commit 76d110a

Browse files
committed
Add confirmation before turning on the override, using text from Firefox 52 screen sharing
1 parent f0e229e commit 76d110a

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,26 @@ adds a toolbar button for toggling the **media.navigator.permission.disabled**
66
setting on and off. SeaMonkey does not have a permissions dialog to let the
77
user select a camera and microphone (see
88
[bug 956854](https://bugzilla.mozilla.org/show_bug.cgi?id=956854)), so
9-
overriding the permissions dialog is the only way to enable WebRTC support.
9+
overriding the permissions dialog by turning this setting on is the only way to enable WebRTC support.
1010

11-
Of course, leaving this setting on is *very insecure*, since any web site
12-
will be able to get access to your microphone and camera! So be sure to only
13-
turn it on when you need to use WebRTC, and **turn it off** once you have
14-
your webcam up and running.
11+
Of course, leaving this setting on is very insecure, since any web site
12+
that's open will be able to get access to your microphone, camera, and screen! So be sure to only
13+
turn it on when you need to use WebRTC, and turn it off once you're done with it.
1514

1615
Opening a new browser window will also turn off the permissions dialog
1716
override, unless you disable this behavior in the extension preferences.
1817

18+
NOTE: your first camera/screen/etc. will be chosen automatically. If you
19+
need to select a particular camera, mic, screen, or window to share, you'll
20+
have to use another web browser (like Firefox.)
21+
1922
Releases
2023
--------
2124

2225
Check the GitHub [releases section](https://github.com/IsaacSchemm/webrtc-permissions-ui-toggle/releases)
2326
for an XPI file that you can install.
2427

25-
This extension might also work in Firefox (tested with Firefox 52), but since
26-
it's unsigned, you'll need to use the Developer Edition or a non-branded
27-
build. However, since Firefox already has a WebRTC permissions dialog, this
28-
extension is **not recommended** for Firefox and should not be necessary.
28+
This extension might also work in Firefox, but you'll need to add Firefox to
29+
the install.rdf and build the extension yourself. Since Firefox already has a
30+
WebRTC permissions dialog, this extension is not recommended for Firefox and
31+
should not be necessary.

chrome/button.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ this.addEventListener("load", function () {
1919
if (newValue) {
2020
toolbarbutton.label = toolbarbutton.tooltipText = "WebRTC Auto (On)";
2121
toolbarbutton.classList.add("setting-true");
22-
message = "Automatic WebRTC connection has been turned on (permissions dialog overridden).\nYou might need to refresh the current page.";
22+
message = "Automatic WebRTC connection has been turned on. Make sure to turn it off when you're done!\nYou might need to refresh the current page.";
2323
} else {
2424
toolbarbutton.label = toolbarbutton.tooltipText = "WebRTC Auto (Off)";
2525
toolbarbutton.classList.remove("setting-true");
26-
message = "Automatic WebRTC connection has been turned off (permissions dialog re-enabled).";
26+
message = "Automatic WebRTC connection has been turned off.";
2727
}
2828

2929
var type = Components.classes["@mozilla.org/preferences-service;1"]
@@ -81,6 +81,12 @@ this.addEventListener("unload", function () {
8181
WebRTCPermissionsButtons = {
8282
TogglePermissionsUI: function (toolbarbutton) {
8383
var actualValue = prefs.getBoolPref("disabled");
84-
prefs.setBoolPref("disabled", !actualValue);
84+
if (actualValue) {
85+
prefs.setBoolPref("disabled", false);
86+
} else if (confirm(`Only use this feature with sites you trust. Sharing can allow deceptive sites to browse as you and steal your private data.
87+
Are you sure you want to share your camera, microphone, and screen with all open web sites?
88+
`)) {
89+
prefs.setBoolPref("disabled", true);
90+
}
8591
}
8692
}

install.rdf

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,13 @@
1111
em:creator="Isaac Schemm"
1212

1313
14-
em:version="1.0"
14+
em:version="1.0.1"
1515
em:homepageURL="https://github.com/IsaacSchemm/webrtc-permissions-ui-toggle"
1616

1717
em:iconURL="chrome://webrtc-permissions-ui-toggle/content/icon.png"
1818
em:optionsURL="chrome://webrtc-permissions-ui-toggle/content/options.xul"
1919
em:optionsType="2" >
2020

21-
<em:targetApplication>
22-
<!-- Firefox -->
23-
<Description>
24-
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
25-
<em:minVersion>49.0</em:minVersion>
26-
<em:maxVersion>*</em:maxVersion>
27-
</Description>
28-
</em:targetApplication>
29-
3021
<em:targetApplication>
3122
<!-- SeaMonkey -->
3223
<Description>
@@ -36,12 +27,6 @@
3627
</Description>
3728
</em:targetApplication>
3829

39-
<em:file>
40-
<Description
41-
about="urn:mozilla:extension:webrtc-permissions-ui-toggle"
42-
em:package="content/webrtc-permissions-ui-toggle/" />
43-
</em:file>
44-
4530
</Description>
4631

4732
</RDF>

0 commit comments

Comments
 (0)