Add Firefox support (#42)
This commit is contained in:
@@ -40,6 +40,10 @@ js/inject.dist.js: $(BROWSERIFY) inject.js
|
||||
[ -d js ] || mkdir -p js
|
||||
$(BROWSERIFY) -o js/inject.dist.js inject.js
|
||||
|
||||
# Firefox requires the last command to evaluate to something serializable
|
||||
# https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript#Return_value
|
||||
echo ";undefined" >> js/inject.dist.js
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf $(CLEAN_FILES)
|
||||
|
@@ -492,7 +492,7 @@ async function parseFields(settings, login) {
|
||||
lines.forEach(function(line) {
|
||||
// split key / value
|
||||
var parts = line
|
||||
.split(/(?<=^[^:]+):/)
|
||||
.split(":")
|
||||
.map(value => value.trim())
|
||||
.filter(value => value.length);
|
||||
if (parts.length != 2) {
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/options.dist.css" />
|
||||
<script src="../js/options.dist.js"></script>
|
||||
</head>
|
||||
|
@@ -69,9 +69,11 @@ h3:first-child {
|
||||
|
||||
.add-store {
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
display: inline-block;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 30px;
|
||||
color: rgb(17, 85, 204);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.error {
|
||||
|
@@ -24,7 +24,7 @@ function Interface(settings, logins) {
|
||||
this.settings = settings;
|
||||
this.logins = logins;
|
||||
this.results = [];
|
||||
this.currentDomainOnly = !settings.tab.url.match(/^chrome:\/\//);
|
||||
this.currentDomainOnly = !settings.tab.url.match(/^(chrome|about):/);
|
||||
this.searchPart = new SearchInterface(this);
|
||||
|
||||
// initialise with empty search
|
||||
|
@@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" type="text/css" href="../css/popup.dist.css" />
|
||||
<script src="../js/popup.dist.js"></script>
|
||||
</head>
|
||||
|
@@ -141,10 +141,14 @@ async function withLogin(action) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Firefox requires data to be serializable,
|
||||
// this removes everything offending such as functions
|
||||
const login = JSON.parse(JSON.stringify(this.login));
|
||||
|
||||
// hand off action to background script
|
||||
var response = await chrome.runtime.sendMessage({
|
||||
action: action,
|
||||
login: this.login
|
||||
login: login
|
||||
});
|
||||
if (response.status != "ok") {
|
||||
throw new Error(response.message);
|
||||
|
@@ -30,7 +30,7 @@ body {
|
||||
white-space: nowrap;
|
||||
background-color: @bg-color;
|
||||
color: @text-color;
|
||||
font-weight: 200;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
html::-webkit-scrollbar,
|
||||
|
Reference in New Issue
Block a user