Bug 1763672 - Introduce targetTopLevelLinkClicksToBlank on BrowsingContext. r=nika
This property defaults to false. When set to true, user-initiated link clicks in the top-level BrowsingContext will default target to _blank. This is similar to what we do for App Tabs, but is slightly more aggressive in that in will also occur for same-origin navigations. Differential Revision: https://phabricator.services.mozilla.com/D143374
This commit is contained in:
@@ -317,6 +317,8 @@ void CanonicalBrowsingContext::ReplacedBy(
|
||||
// about:blank documents created in it.
|
||||
txn.SetSandboxFlags(GetSandboxFlags());
|
||||
txn.SetInitialSandboxFlags(GetSandboxFlags());
|
||||
txn.SetTargetTopLevelLinkClicksToBlankInternal(
|
||||
TargetTopLevelLinkClicksToBlank());
|
||||
if (aNewContext->EverAttached()) {
|
||||
MOZ_ALWAYS_SUCCEEDS(txn.Commit(aNewContext));
|
||||
} else {
|
||||
@@ -2678,6 +2680,12 @@ void CanonicalBrowsingContext::SetTouchEventsOverride(
|
||||
SetTouchEventsOverrideInternal(aOverride, aRv);
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::SetTargetTopLevelLinkClicksToBlank(
|
||||
bool aTargetTopLevelLinkClicksToBlank, ErrorResult& aRv) {
|
||||
SetTargetTopLevelLinkClicksToBlankInternal(aTargetTopLevelLinkClicksToBlank,
|
||||
aRv);
|
||||
}
|
||||
|
||||
void CanonicalBrowsingContext::AddPageAwakeRequest() {
|
||||
MOZ_ASSERT(IsTop());
|
||||
auto count = GetPageAwakeRequestCount();
|
||||
|
||||
Reference in New Issue
Block a user