Skip to content

Commit

Permalink
:(
Browse files Browse the repository at this point in the history
  • Loading branch information
nmsderp authored Mar 6, 2024
1 parent df88841 commit dae0c01
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/extension-support/extension-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class ExtensionManager {

/**
* Load an extension by URL or internal extension ID
* @param {string} normalURL - the URL for the extension to load OR the ID of an internal extension
* @param {string} extensionURL - the URL for the extension to load OR the ID of an internal extension
* @returns {Promise} resolved once the extension is loaded and initialized or rejected on failure
*/
async loadExtensionURL(extensionURL) {
Expand All @@ -417,26 +417,21 @@ class ExtensionManager {
if (!this._isValidExtensionURL(extensionURL)) {
throw new Error(`Invalid extension URL: ${extensionURL}`);
}
if (extensionURL.includes("penguinmod.site")) {
alert("Extensions using penguinmod.site are deprecated, please swap them over to use penguinmod.com instead.")
}
const normalURL = extensionURL.replace("penguinmod.site", "penguinmod.com");


this.runtime.setExternalCommunicationMethod('customExtensions', true);

this.loadingAsyncExtensions++;

const sandboxMode = await this.securityManager.getSandboxMode(normalURL);
const rewritten = await this.securityManager.rewriteExtensionURL(normalURL);
const sandboxMode = await this.securityManager.getSandboxMode(extensionURL);

if (sandboxMode === 'unsandboxed') {
const { load } = require('./tw-unsandboxed-extension-runner');
const extensionObjects = await load(extensionURL, this.vm)
.catch(error => this._failedLoadingExtensionScript(error));
const fakeWorkerId = this.nextExtensionWorker++;
const returnedIDs = [];
this.workerURLs[fakeWorkerId] = normalURL;
this.workerURLs[fakeWorkerId] = extensionURL;

for (const extensionObject of extensionObjects) {
const extensionInfo = extensionObject.getInfo();
Expand Down

0 comments on commit dae0c01

Please sign in to comment.