diff --git a/gui/scripts/compat.js b/gui/scripts/compat.js deleted file mode 100644 index 16048b6..0000000 --- a/gui/scripts/compat.js +++ /dev/null @@ -1,37 +0,0 @@ -/* compat.js -You shouldn't be opening the HTMLs elsewhere. */ - -// Import modules. -import texts from "./read.JS"; - -// Initialize browser data. -let browser_data = {}; - -function refresh() { - /* Update variable containing the browser data. - - Returns: (dict) the updated browser data - */ - - browser_data.URL = window.location.href; - return (browser_data.URL); -} - -export default class compat { - static restrict() { - /* Restrict pages containing this function from being loaded outside the extension. - - Returns: (bool) page open is correct - */ - - refresh(); - - const browser_extension_URL_contents = new RegExp(`^(?!file:\/\/|http:\/\/|https:\/\/)(.*-extension:\/\/.*)`); - const browser_condition_met = browser_extension_URL_contents.test(browser_data.URL); - if (!browser_condition_met) { - alert(texts.universal(`invalid_open`)); - } - - return (browser_condition_met); - } -} diff --git a/gui/scripts/popup.js b/gui/scripts/popup.js index 7e9bf52..53387b8 100644 --- a/gui/scripts/popup.js +++ b/gui/scripts/popup.js @@ -3,7 +3,6 @@ */ // Import modules. -import compat from "./compat.js"; import texts from "./read.JS"; // Call the main function.