Browse Source

added minimum firefox version

dev
Kyle Mitchell 2 years ago
parent
commit
b5fdd735c6
3 changed files with 20 additions and 14 deletions
  1. +4
    -4
      js/home.js
  2. +8
    -8
      js/options.js
  3. +8
    -2
      manifest.json

+ 4
- 4
js/home.js View File

@@ -1,5 +1,5 @@
function restore_options() {
chrome.storage.sync.get("links", function(result){
browser.storage.sync.get("links", function(result){
var quads = document.querySelectorAll('a')
for (i = 0; i < quads.length; i++) {
if (result.links[i]) {
@@ -9,7 +9,7 @@ function restore_options() {
}
}
})
chrome.storage.sync.get("colors", function(result){
browser.storage.sync.get("colors", function(result){
var quads = document.querySelectorAll('a')
var style = document.createElement('style');
for (i = 0; i < quads.length; i++) {
@@ -21,7 +21,7 @@ function restore_options() {
}
document.head.appendChild(style)
})
chrome.storage.sync.get("mode", function(result){
browser.storage.sync.get("mode", function(result){
if (result.mode) {
switch(result.mode) {
case "light":
@@ -35,7 +35,7 @@ function restore_options() {
}
} else {
mode = "light"
chrome.storage.sync.set({mode:"light"})
browser.storage.sync.set({mode:"light"})
}
})
}


+ 8
- 8
js/options.js View File

@@ -13,12 +13,12 @@ function save_options() {
links.push(input_links[i].value)
colors.push(input_colors[i].value)
}
chrome.storage.sync.set({links:links, colors:colors})
browser.storage.sync.set({links:links, colors:colors})
console.log("Settings Saved ")
}
function restore_options() {
var mode
chrome.storage.sync.get("mode", function(result){
browser.storage.sync.get("mode", function(result){
if (result.mode) {
switch(result.mode) {
case "light":
@@ -32,17 +32,17 @@ function restore_options() {
}
} else {
mode = "light"
chrome.storage.sync.set({mode:"light"})
browser.storage.sync.set({mode:"light"})
save_options()
}
})
chrome.storage.sync.get("links", function(result){
browser.storage.sync.get("links", function(result){
var input_links = document.querySelectorAll('input[type="text"]')
for (i = 0; i < input_links.length; i++) {
input_links[i].value = result.links[i]
}
})
chrome.storage.sync.get("colors", function(result){
browser.storage.sync.get("colors", function(result){
var input_colors = document.querySelectorAll('input[type="color"]')
for (i = 0; i < input_colors.length; i++) {
if (result.colors[i]) {
@@ -52,13 +52,13 @@ function restore_options() {
})
}
function change_mode() {
chrome.storage.sync.get("mode", function(result){
browser.storage.sync.get("mode", function(result){
var input_colors = document.querySelectorAll('input[type="color"]')
switch(result.mode) {
case "light":
document.body.classList.add('dark')
mode = "dark"
chrome.storage.sync.set({mode:"dark"})
browser.storage.sync.set({mode:"dark"})
for (i = 0; i < input_colors.length; i++) {
if (input_colors[i].value == "#cfcfcf") {
input_colors[i].value = "#323234"
@@ -69,7 +69,7 @@ function change_mode() {
case "dark":
document.body.classList.remove('dark')
mode = "light"
chrome.storage.sync.set({mode:"light"})
browser.storage.sync.set({mode:"light"})
for (i = 0; i < input_colors.length; i++) {
if (input_colors[i].value == "#323234") {
input_colors[i].value = "#cfcfcf"


+ 8
- 2
manifest.json View File

@@ -1,7 +1,7 @@
{
"name": "Placid Tab 2 - New Tab Page",
"short_name": "Placid Tab 2",
"version": "1.0.0",
"version": "1.0.0.1",
"manifest_version": 2,
"description": "A minimal New Tab page",
"author": "Kyle Mitchell",
@@ -11,5 +11,11 @@
"icons": { "16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png" },
"permissions": ["storage"]
"permissions": ["storage"],
"applications": {
"gecko": {
"id": "placidtab2@kylemitchell.me",
"strict_min_version": "57.0"
}
}
}

Loading…
Cancel
Save