From e7b9897c097db80b836d0c8df2e1396653118f36 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 29 Mar 2021 13:29:03 +0200 Subject: [PATCH] load files from parent --- apps/remix-ide/src/app.js | 4 ---- apps/remix-ide/src/loadFilesFromParent.js | 22 ---------------------- 2 files changed, 26 deletions(-) delete mode 100644 apps/remix-ide/src/loadFilesFromParent.js diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 73c7c66949..ce1919451a 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -25,7 +25,6 @@ const csjs = require('csjs-inject') const yo = require('yo-yo') const remixLib = require('@remix-project/remix-lib') const registry = require('./global/registry') -const loadFileFromParent = require('./loadFilesFromParent') const { OffsetToLineColumnConverter } = require('./lib/offsetToLineColumnConverter') const QueryParams = require('./lib/query-params') const Storage = remixLib.Storage @@ -491,8 +490,5 @@ Please make a backup of your contracts and start using http://remix.ethereum.org const framingService = new FramingService(sidePanel, menuicons, mainview, this._components.resizeFeature) framingService.start(params) - // get the file list from the parent iframe - loadFileFromParent(fileManager) - if (params.embed) framingService.embed() } diff --git a/apps/remix-ide/src/loadFilesFromParent.js b/apps/remix-ide/src/loadFilesFromParent.js deleted file mode 100644 index 73d9006a1e..0000000000 --- a/apps/remix-ide/src/loadFilesFromParent.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = (fileManager) => { - // The event listener needs to be registered as early as possible, because the - // parent will send the message upon the "load" event. - let filesToLoad = null - let loadFilesCallback = function (files) { filesToLoad = files } // will be replaced later - - window.addEventListener('message', function (ev) { - if (typeof ev.data === typeof [] && ev.data[0] === 'loadFiles') { - loadFilesCallback(ev.data[1]) - } - }, false) - - // Replace early callback with instant response - loadFilesCallback = function (files) { - fileManager.setBatchFiles(files) - } - - // Run if we did receive an event from remote instance while starting up - if (filesToLoad !== null) { - fileManager.setBatchFiles(filesToLoad) - } -}