Compare commits
3 Enmetoj
d4ad23b893
...
7f07d30f56
Author | SHA1 | Date | |
---|---|---|---|
Jaidyn Ann | 7f07d30f56 | ||
Jaidyn Ann | 268c29263d | ||
Jaidyn Ann | 3b09eb6d2a |
|
@ -3,22 +3,30 @@ let port = undefined;
|
|||
// Run the shellfox helper program.
|
||||
function initShellfoxProgram() {
|
||||
port = browser.runtime.connectNative("shellfox");
|
||||
port.onDisconnect.addListener((port) => {
|
||||
console.log(port.error);
|
||||
port = undefined;
|
||||
if (!port)
|
||||
shellfoxFailed();
|
||||
else
|
||||
port.onDisconnect.addListener(shellfoxFailed);
|
||||
}
|
||||
|
||||
// Tell the user about the error…
|
||||
browser.tabs.query({"active": true}).then((tabs) => {
|
||||
let openerTab = undefined;
|
||||
if (tabs && tabs.length > 0)
|
||||
openerTab = tabs[0].id;
|
||||
|
||||
browser.tabs.create({
|
||||
"active": true,
|
||||
"url": "/error.html",
|
||||
"openerTabId": openerTab
|
||||
})
|
||||
});
|
||||
// Display an error when we fail to launch Shellfox’es script.
|
||||
function shellfoxFailed() {
|
||||
let error = port.error;
|
||||
console.log(error);
|
||||
port = undefined;
|
||||
|
||||
// Tell the user about the error…
|
||||
browser.tabs.query({"active": true}).then((tabs) => {
|
||||
let openerTab = undefined;
|
||||
if (tabs && tabs.length > 0)
|
||||
openerTab = tabs[0].id;
|
||||
|
||||
browser.tabs.create({
|
||||
"active": true,
|
||||
"url": "/html/error.html?error=" + escape(error),
|
||||
"openerTabId": openerTab
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
|
||||
<body>
|
||||
<h1 id="errorTitle">Shellfox failed to run command</h1>
|
||||
<h2><span class="command"></span></h2>
|
||||
<h2 id="error"></h2>
|
||||
|
||||
<h3 id="notInstalled">It seems that Shellfox is not fully installed!</h3>
|
||||
<h2 id="notInstalled">It seems that Shellfox is not fully installed!</h2>
|
||||
<p id="notInstalledDesc">Shellfox, unlike most extensions, requires a script to be installed on your computer. This script, <code>shellfox.sh</code>, is what allows us to execute shell commands.</p>
|
||||
|
||||
<h3 id="installTitle">Completing installation</h3>
|
|
@ -1,3 +1,9 @@
|
|||
let urlParams = location.toString().split("?error=");
|
||||
if (urlParams && urlParams.length > 0) {
|
||||
let errorText = unescape(urlParams[urlParams.length - 1]);
|
||||
document.getElementById("error").innerText = "«" + errorText + "»";
|
||||
}
|
||||
|
||||
document.getElementsByTagName("html")[0].setAttribute("lang", browser.i18n.getMessage("@@ui_locale"));
|
||||
|
||||
document.getElementById("errorPageTitle").innerText = browser.i18n.getMessage("errorPageTitle");
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 276 B |
After Width: | Height: | Size: 615 B |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
@ -9,16 +9,16 @@
|
|||
"default_locale": "en",
|
||||
|
||||
"icons": {
|
||||
"250": "res/shellfox.png",
|
||||
"38": "res/shellfox-38.png",
|
||||
"19": "res/shellfox-19.png"
|
||||
"250": "img/shellfox.png",
|
||||
"38": "img/shellfox-38.png",
|
||||
"19": "img/shellfox-19.png"
|
||||
},
|
||||
|
||||
"page_action": {
|
||||
"default_icon": {
|
||||
"250": "res/shellfox-action.png",
|
||||
"38": "res/shellfox-action-38.png",
|
||||
"19": "res/shellfox-action-19.png"
|
||||
"150": "img/shellfox-action.png",
|
||||
"38": "img/shellfox-action-38.png",
|
||||
"19": "img/shellfox-action-19.png"
|
||||
},
|
||||
"default_title": "__MSG_pageActionName__"
|
||||
},
|
||||
|
@ -45,6 +45,6 @@
|
|||
},
|
||||
|
||||
"options_ui": {
|
||||
"page": "options.html"
|
||||
"page": "html/options.html"
|
||||
}
|
||||
}
|
||||
|
|
Before Width: | Height: | Size: 197 B |
Before Width: | Height: | Size: 374 B |
Before Width: | Height: | Size: 1.6 KiB |