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
Tor Browser
Commits
ac057aaa
Commit
ac057aaa
authored
Mar 15, 2018
by
Yuki Hiroshi
Browse files
Bug 1440574 - Policy: Disable commands to send feedback. r=felipe
parent
335cdd19
Changes
6
Hide whitespace changes
Inline
Side-by-side
browser/base/content/browser-safebrowsing.js
View file @
ac057aaa
...
...
@@ -23,21 +23,16 @@ var gSafeBrowsing = {
document
.
getElementById
(
"
menu_HelpPopup_reportPhishingErrortoolmenu
"
)
.
hidden
=
!
isPhishingPage
;
var
broadcasterId
=
isPhishingPage
?
"
reportPhishingErrorBroadcaster
"
:
"
reportPhishingBroadcaster
"
;
var
broadcaster
=
document
.
getElementById
(
broadcasterId
);
if
(
!
broadcaster
)
return
;
// Now look at the currentURI to learn which page we were trying
// to browse to.
let
uri
=
gBrowser
.
currentURI
;
if
(
uri
&&
(
uri
.
schemeIs
(
"
http
"
)
||
uri
.
schemeIs
(
"
https
"
)))
broadcaster
.
removeAttribute
(
"
disabled
"
);
else
broadcaster
.
setAttribute
(
"
disabled
"
,
true
);
const
uri
=
gBrowser
.
currentURI
;
const
isReportablePage
=
uri
&&
(
uri
.
schemeIs
(
"
http
"
)
||
uri
.
schemeIs
(
"
https
"
));
const
disabledByPolicy
=
!
Services
.
policies
.
isAllowed
(
"
feedbackCommands
"
);
document
.
getElementById
(
"
reportPhishingBroadcaster
"
)
.
disabled
=
disabledByPolicy
||
isPhishingPage
||
!
isReportablePage
;
document
.
getElementById
(
"
reportPhishingErrorBroadcaster
"
)
.
disabled
=
disabledByPolicy
||
!
isPhishingPage
||
!
isReportablePage
;
},
/**
...
...
browser/base/content/utilityOverlay.js
View file @
ac057aaa
...
...
@@ -829,6 +829,9 @@ function openTourPage() {
}
function
buildHelpMenu
()
{
document
.
getElementById
(
"
feedbackPage
"
)
.
disabled
=
!
Services
.
policies
.
isAllowed
(
"
feedbackCommands
"
);
// Enable/disable the "Report Web Forgery" menu item.
if
(
typeof
gSafeBrowsing
!=
"
undefined
"
)
{
gSafeBrowsing
.
setReportPhishingMenu
();
...
...
browser/components/enterprisepolicies/Policies.jsm
View file @
ac057aaa
...
...
@@ -149,6 +149,14 @@ var Policies = {
}
},
"DisableFeedbackCommands": {
onBeforeUIStartup(manager, param) {
if (param) {
manager.disallowFeature("feedbackCommands");
}
}
},
"DisableFirefoxAccounts": {
onBeforeAddons(manager, param) {
if (param) {
...
...
browser/components/enterprisepolicies/schemas/policies-schema.json
View file @
ac057aaa
...
...
@@ -114,6 +114,13 @@
"type"
:
"boolean"
},
"DisableFeedbackCommands"
:
{
"description"
:
"Prevents ability to send feedback from the help menu (
\"
Submit Feedback
\"
and
\"
Report Deceptive Site
\"
)."
,
"first_available"
:
"60.0"
,
"type"
:
"boolean"
},
"DisableFirefoxAccounts"
:
{
"description"
:
"Disables Firefox Account based services, including Sync."
,
"first_available"
:
"60.0"
,
...
...
browser/components/enterprisepolicies/tests/browser/browser.ini
View file @
ac057aaa
...
...
@@ -24,6 +24,7 @@ support-files =
[browser_policy_bookmarks.js]
[browser_policy_clear_blocked_cookies.js]
[browser_policy_default_browser_check.js]
[browser_policy_disable_feedback_commands.js]
[browser_policy_disable_formhistory.js]
[browser_policy_disable_fxaccounts.js]
[browser_policy_disable_fxscreenshots.js]
...
...
browser/components/enterprisepolicies/tests/browser/browser_policy_disable_feedback_commands.js
0 → 100644
View file @
ac057aaa
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"
use strict
"
;
/* the buidHelpMenu() function comes from browser/base/content/utilityOverlay.js */
const
NORMAL_PAGE
=
"
http://example.com
"
;
const
PHISH_PAGE
=
"
http://www.itisatrap.org/firefox/its-a-trap.html
"
;
async
function
checkItemsAreDisabled
(
url
)
{
await
BrowserTestUtils
.
withNewTab
({
gBrowser
,
url
,
// The phishing page doesn't send a load notification
waitForLoad
:
false
,
waitForStateStop
:
true
,
},
async
function
checkItems
()
{
buildHelpMenu
();
let
reportMenu
=
document
.
getElementById
(
"
menu_HelpPopup_reportPhishingtoolmenu
"
);
is
(
reportMenu
.
getAttribute
(
"
disabled
"
),
"
true
"
,
"
The `Report Deceptive Site` item should be disabled
"
);
let
errorMenu
=
document
.
getElementById
(
"
menu_HelpPopup_reportPhishingErrortoolmenu
"
);
is
(
errorMenu
.
getAttribute
(
"
disabled
"
),
"
true
"
,
"
The `This isn’t a deceptive site` item should be disabled
"
);
});
}
add_task
(
async
function
test_policy_feedback_commands
()
{
await
setupPolicyEngineWithJson
({
"
policies
"
:
{
"
DisableFeedbackCommands
"
:
true
}
});
/* from browser/base/content/utilityOverlay.js */
buildHelpMenu
();
let
feedbackPageMenu
=
document
.
getElementById
(
"
feedbackPage
"
);
is
(
feedbackPageMenu
.
getAttribute
(
"
disabled
"
),
"
true
"
,
"
The `Submit Feedback...` item should be disabled
"
);
await
checkItemsAreDisabled
(
NORMAL_PAGE
);
await
checkItemsAreDisabled
(
PHISH_PAGE
);
});
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