Show error in popup.
This commit is contained in:
parent
de5d65d32a
commit
e05b154e21
|
@ -7,6 +7,7 @@
|
|||
<label for="tags">Tags, comma separated:</label>
|
||||
<input type="text" id="tags" autofocus>
|
||||
<input type="button" id="button" value="Add URI">
|
||||
<div id="error"></div>
|
||||
|
||||
<script src="launch.js"></script>
|
||||
</body>
|
||||
|
|
|
@ -18,11 +18,21 @@ function get_tags() // get tags from text input.
|
|||
}
|
||||
|
||||
function onResponse(response) {
|
||||
console.log("Received: " + response);
|
||||
console.log("Received: " + response);
|
||||
if (response == "Command successful.")
|
||||
{
|
||||
window.close();
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("error").innerHTML =
|
||||
"<strong>" + response + "</strong>";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function onError(error) {
|
||||
console.log(`Error: ${error}`);
|
||||
console.log(`Error: ${error}`);
|
||||
}
|
||||
|
||||
function launch() // Launch wrapper and send tags + URL to stdin.
|
||||
|
@ -31,7 +41,6 @@ function launch() // Launch wrapper and send tags + URL to stdin.
|
|||
console.log("Sending: " + arguments + " to remwharead");
|
||||
var sending = browser.runtime.sendNativeMessage("remwharead", arguments);
|
||||
sending.then(onResponse, onError);
|
||||
window.close();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue