diff --git a/pages/open/popup.htm b/pages/open/popup.htm index 3122b25..cfaaa6b 100644 --- a/pages/open/popup.htm +++ b/pages/open/popup.htm @@ -1,5 +1,5 @@
- + diff --git a/pages/open/settings.htm b/pages/open/settings.htm index 20f6411..cfaaa6b 100644 --- a/pages/open/settings.htm +++ b/pages/open/settings.htm @@ -1,8 +1,5 @@ - + diff --git a/scripts/GUI/windowman.js b/scripts/GUI/windowman.js index 6417923..bc55221 100644 --- a/scripts/GUI/windowman.js +++ b/scripts/GUI/windowman.js @@ -9,12 +9,7 @@ let DEBUG = true; export default class windowman { static new(URL, height, width) { - this.window = chrome.windows.create({ - url: chrome.runtime.getURL(URL), - type: "popup", - width: width ? parseInt(width) : 600, - height: height ? parseInt(height) : 600, - }); + this.window = chrome.windows.create({url: (URL.includes(`://`)) ? URL : chrome.runtime.getURL(URL), type: "popup", width: width ? parseInt(width) : 600, height: height ? parseInt(height) : 600}); } // Prepare the window with its metadata. diff --git a/scripts/pages/open.js b/scripts/pages/open.js new file mode 100644 index 0000000..dbcb964 --- /dev/null +++ b/scripts/pages/open.js @@ -0,0 +1,20 @@ +// Open the settings in a pop-up window. + +import windowman from "/scripts/GUI/windowman.JS"; + +function redirect() { + let location = {}; + location[`original`] = window.location.href; + location[`page`] = [...location[`original`].split(`/`)].pop(); + location[`target`] = chrome.runtime.getURL("pages/".concat(location[`page`])); + + windowman.new(location[`target`]); + + window.close(); +} + +function main() { + redirect(); +} + +main();