diff --git a/editor.js b/editor.js index ee21909..fc4fed1 100644 --- a/editor.js +++ b/editor.js @@ -48,6 +48,9 @@ class FMEditor { } async getPageContent (newest) { + if (this.bgData.revid === 0) { + return '' + } const response = await window.fetch(`${this.bgData.api}/api.php?format=json&action=query&prop=revisions&rvprop=content&` + (newest ? `titles=${this.bgData.title}&cb=${new Date().getTime() / 1000}` : `revids=${this.bgData.revid}`)) const json = await response.json() const content = json.query.pages[Object.keys(json.query.pages)[0]].revisions ? json.query.pages[Object.keys(json.query.pages)[0]].revisions[0]['*'] : '' diff --git a/manifest.json b/manifest.json index 7c2021a..745b53e 100644 --- a/manifest.json +++ b/manifest.json @@ -7,7 +7,7 @@ }, "manifest_version": 2, "name": "FANDOM Monaco", - "version": "1.2.1", + "version": "1.2.2", "description": "Integrate Monaco Editor into FANDOM.", "background": { "scripts": [