mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1735746
- Add a pref and limit external protocol sandbox blocking to Nightly. r=ckerschb,farre
Depends on D141131 Differential Revision: https://phabricator.services.mozilla.com/D141132
This commit is contained in:
parent
1e4838aeeb
commit
6f039abdf3
@ -1916,6 +1916,12 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Block sandboxed BrowsingContexts from navigating to external protocols.
|
||||
- name: dom.block_external_protocol_navigation_from_sandbox
|
||||
type: bool
|
||||
value: @IS_NIGHTLY_BUILD@
|
||||
mirror: always
|
||||
|
||||
# Block Insecure downloads from Secure Origins
|
||||
- name: dom.block_download_insecure
|
||||
type: bool
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "mozilla/dom/CanonicalBrowsingContext.h"
|
||||
#include "mozilla/dom/WindowGlobalParent.h"
|
||||
#include "mozilla/RandomNum.h"
|
||||
#include "mozilla/StaticPrefs_dom.h"
|
||||
#include "mozilla/StaticPrefs_security.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsXULAppAPI.h"
|
||||
@ -1099,6 +1100,10 @@ nsresult nsExternalHelperAppService::EscapeURI(nsIURI* aURI, nsIURI** aResult) {
|
||||
bool ExternalProtocolIsBlockedBySandbox(
|
||||
BrowsingContext* aBrowsingContext,
|
||||
const bool aHasValidUserGestureActivation) {
|
||||
if (!StaticPrefs::dom_block_external_protocol_navigation_from_sandbox()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!aBrowsingContext || aBrowsingContext->IsTop()) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user