зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1312690: Add some stupid microoptimizations. r=aswan
MozReview-Commit-ID: 4qoNuG2k0KS --HG-- extra : rebase_source : fff22127b80bb8edc8578c2035d4689452ed4f6e
This commit is contained in:
Родитель
46cb76edfa
Коммит
92f05e0b16
|
@ -215,11 +215,11 @@ Script.prototype = {
|
|||
*/
|
||||
tryInject(window, sandbox, shouldRun, when) {
|
||||
if (shouldRun("document_start")) {
|
||||
let {cssURLs} = this;
|
||||
if (cssURLs.length > 0) {
|
||||
let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
|
||||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
||||
let {cssURLs} = this;
|
||||
if (cssURLs.length > 0) {
|
||||
let method = this.remove_css ? winUtils.removeSheetUsingURIString : winUtils.loadSheetUsingURIString;
|
||||
for (let url of cssURLs) {
|
||||
runSafeSyncWithoutClone(method, url, winUtils.AUTHOR_SHEET);
|
||||
|
|
|
@ -239,8 +239,7 @@ var Service = {
|
|||
// extensionURIToAddonID, which ensures that we don't inject our
|
||||
// API into webAccessibleResources or remote web pages.
|
||||
function getAddonIdForWindow(window) {
|
||||
let principal = window.document.nodePrincipal;
|
||||
return principal.originAttributes.addonId;
|
||||
return Cu.getObjectPrincipal(window).originAttributes.addonId;
|
||||
}
|
||||
|
||||
const API_LEVELS = Object.freeze({
|
||||
|
|
Загрузка…
Ссылка в новой задаче