Skip to content

Commit

Permalink
Initialize and start extension
Browse files Browse the repository at this point in the history
  • Loading branch information
chingc committed Nov 23, 2018
1 parent 01b6337 commit 33949c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,

"name": "Lookup Assistant",
"version": "2.1.0",
"version": "2.1.1",

"description": "Lookup highlighted text.",
"icons": {
Expand Down
8 changes: 7 additions & 1 deletion scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"use strict";

const doc = (id) => document.getElementById(id);

const storage = {
key: "LUA_Settings",
get: () => localStorage.getItem(storage.key),
Expand Down Expand Up @@ -175,6 +175,12 @@
}
]`.replace(/\n {4}/g, "\n");

// initialize storage and settings on installation
if (storage.get() === null) {
storage.set(defaults);
settings._parse(JSON.parse(defaults));
}

document.onreadystatechange = () => {
if (document.title.includes("Lookup Assistant") && document.readyState !== "loading") {
doc("editor").value = storage.get();
Expand Down

0 comments on commit 33949c7

Please sign in to comment.