diff --git a/apps/remix-ide/src/app/editor/editor.js b/apps/remix-ide/src/app/editor/editor.js index 3d429697d4..13deab26e9 100644 --- a/apps/remix-ide/src/app/editor/editor.js +++ b/apps/remix-ide/src/app/editor/editor.js @@ -324,6 +324,13 @@ class Editor extends Plugin { * @param {string} content Content of the document or update. */ open (path, content) { + /* + we have the following cases: + - URL prepended with "localhost" + - URL prepended with "browser" + - URL not prepended with the file explorer. We assume (as it is in the whole app, that this is a "browser" URL + */ + if (!path.startsWith('localhost') && !path.startsWith('browser')) path = `browser/${path}` if (!this.sessions[path]) { const session = this._createSession(content, this._getMode(path)) this.sessions[path] = session