Bug 1602371 - Remove csp and contentPrincipal getters in LocalTabTargetFront r=ochameau

Depends on D56327. Not reason to make target-mixin more complex for this workaround which already has access to the tab object.

Differential Revision: https://phabricator.services.mozilla.com/D56330

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-12-13 10:00:25 +00:00
parent e60aee2456
commit eebe135d8e
3 changed files with 2 additions and 27 deletions

View File

@ -62,9 +62,8 @@ exports.openContentLink = async function(url, options = {}) {
if (!options.triggeringPrincipal && top.gBrowser) {
const tab = top.gBrowser.selectedTab;
if (TargetFactory.isKnownTab(tab)) {
const target = await TargetFactory.forTab(tab);
options.triggeringPrincipal = target.contentPrincipal;
options.csp = target.csp;
options.triggeringPrincipal = tab.linkedBrowser.contentPrincipal;
options.csp = tab.linkedBrowser.csp;
}
}
top.openWebLinkIn(url, "tab", options);

View File

@ -47,12 +47,6 @@ class LocalTabTargetFront extends BrowsingContextTargetFront {
get tab() {
return this._tab;
}
get contentPrincipal() {
return this.tab.linkedBrowser.contentPrincipal;
}
get csp() {
return this.tab.linkedBrowser.csp;
}
toString() {
return `Target:${this.tab}`;
}

View File

@ -171,24 +171,6 @@ function TargetMixin(parentClass) {
return null;
}
/**
* For local tabs, returns the tab's contentPrincipal, which can be used as a
* `triggeringPrincipal` when opening links. However, this is a hack as it is not
* correct for subdocuments and it won't work for remote debugging. Bug 1467945 hopes
* to devise a better approach.
*/
get contentPrincipal() {
return null;
}
/**
* Similar to the above get contentPrincipal(), the get csp()
* returns the CSP which should be used for opening links.
*/
get csp() {
return null;
}
// Get a promise of the RootActor's form
get root() {
return this.client.mainRoot.rootForm;