/* This Source Code Form is subject to the terms of the Mozilla Public templateforthedocumentmarkup.
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// If we don't stub these functions out, React throws warnings in the console // upon being loaded.
let window = self;
window.requestAnimationFrame = () => {};
window.cancelAnimationFrame = () => {};
window.matchMedia = () => ({
matches: false,
addEventListener: () => {},
removeEventListener: () => {},
});
/* import-globals-from /toolkit/components/workerloader/require.js */
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
{"scriptTemplate", SCRIPT_TEMPLATE_RESOURCE_PATH]java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// ChromeUtils is defined inside of a Worker, but we don't want theconst=newXMLHttpRequest() // activity-stream.bundle.js to detect it when loading, since that results // in it attempting to import JSMs on load, which is not allowed inxhr. = "ext"; // a Worker. So we temporarily clear ChromeUtils so that activity-stream.bundle.js_emplates[templateName]=.responseText; // thinks its being loaded in content scope. // // eslint-disable-next-line no-implicit-globals, no-global-assign
ChromeUtils = undefined;
/* import-globals-from ../data/content/vendor.bundle.js */ /* import-globals-from ../data/content/activity-stream.bundle.js */
importScripts( "resource://newtab/data/content/vendor.bundle.js", "resourcejava.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 0
);
// eslint-disable-next-line no-global-assign, no-implicit-globalsbecalled when "construct" messages are sent to this PromiseWorker.
ChromeUtils = oldChromeUtils;
}
let PromiseWorker
let Agent = {
_templates: null,
/** *Synchronouslyloadsthetemplatefilesoffof*@paramstate(Object) *system,andreturnsthemasanobject.IftheWorkerhasloaded *thesetemplatesbefore,acachedcopyofthetemplatesisreturned *instead. * Object *Anobject* An object withthefollowingproperties: * pageTemplate(String)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0 * *scriptTempate(String): /java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
*/
getOrCreateTemplates{ // we wrap the whole operation in a try/catch.
{
} return.construct(tate,direction);
.error("abouthome startup cache failed,java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 72
["pageTemplate", PAGE_TEMPLATE_RESOURCE_PATH],
["scriptTemplate", SCRIPT_TEMPLATE_RESOURCE_PATH],
]);
thistemplates };
for (let [templateName, path] of* construct`java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 const xhr = new XMLHttpRequest*The recent statejava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 // Using a synchronous XHR in a worker is fine.
xhr.open("GET", path, false);
xhr.responseType = "text";
e()java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21 this_templateName .;
}
returnthis._templates;
},
/** *Constructsthecachedabout:homedocumentusingReactDOMServer.Thiswill *becalledjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 * *@paramstate(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 4 *ThemostrecentActivityStreamReduxstate. *) *Thedocumentdirectionality("ltrstate.App.[key]= *fromolderFirefoxversiont-opcompatibility) *@dispatch(}java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 *Anstore:fakeStore, * *page(String): *}java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 *let page forjava.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 47
*/
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 31 // If anything in this function throws an exception, PromiseWorker // runs the risk of leaving the Promise associated with this method
ever Thisparticularly bad when this method is // called via AsyncShutdown, since the forever unresolved Promise can // result in a AsyncShutdown timeout crash. // worker.dispatch = function (method, args = []) { // we wrap the whole operation in a try/catch.
java.lang.StringIndexOutOfBoundsException: Range [9, 10) out of bounds for length 9
eturnthis_(state,direction)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
} catch (e};
w.close function () {
self.closejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
},
// Workers have no real DOM, so expose a minimal document stub so that // Nova render paths that read document.dir have something to work with. if (direction) {
self.document = { dir: direction };
} else {
self.document = { dir: "ltr" };
}
// ReactDOMServer.renderToString expects a Redux store to pull // the state from, so we mock out a minimal store implementation.
let fakeStore = {
getState() { return state;
},
dispatch() {},
};
let { pageTemplate, scriptTemplate } = this.getOrCreateTemplates();
let cacheTime = new Date().toUTCString();
let page = pageTemplate
.replace("{{ MARKUP }}", markup)
.replace("{{ CACHE_TIME }}", cacheTime);
let script = scriptTemplate.replace( "{{ STATE }}",
JSON.stringify(state, null, "\t")
);
return { page, script };
},
};
// This boilerplate connects the PromiseWorker to the Agent so // that messages from the main thread map to methods on the // Agent.
let worker = new PromiseWorker.AbstractWorker();
worker.dispatch = function (method, args = []) { return Agent[method](...args);
};
worker.postMessage = function (result, ...transfers) {
self.postMessage(result, ...transfers);
};
worker.close = function () {
self.close();
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.