diff --git a/gui/popup.htm b/gui/popup.htm index e69de29..088c842 100644 --- a/gui/popup.htm +++ b/gui/popup.htm @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/gui/scripts/compat.js b/gui/scripts/compat.js new file mode 100644 index 0000000..cb4f8b2 --- /dev/null +++ b/gui/scripts/compat.js @@ -0,0 +1 @@ +/* compat.js You shouldn't be opening the HTMLs elsewhere. */ let browser_data = {}; export 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 function 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("This page can not be opened. \r此网页无法打开。"); }; return (browser_condition_met); }; \ No newline at end of file diff --git a/gui/settings.htm b/gui/settings.htm index e69de29..263ced8 100644 --- a/gui/settings.htm +++ b/gui/settings.htm @@ -0,0 +1 @@ + \ No newline at end of file