|
|
@ -1,25 +1,29 @@ |
|
|
|
function restore_options() { |
|
|
|
browser.storage.sync.get("links", function(result){ |
|
|
|
var quads = document.querySelectorAll('a') |
|
|
|
for (i = 0; i < quads.length; i++) { |
|
|
|
if (result.links[i]) { |
|
|
|
var link = result.links[i] |
|
|
|
if (link.substring(0, 4) === 'http' ? link = 'options.html' : link = 'http://' + link) |
|
|
|
quads[i].href = link |
|
|
|
if (result.links) { |
|
|
|
var quads = document.querySelectorAll('a') |
|
|
|
for (i = 0; i < quads.length; i++) { |
|
|
|
if (result.links[i]) { |
|
|
|
var link = result.links[i] |
|
|
|
if (link.substring(0, 4) === 'http' ? link = 'options.html' : link = 'http://' + link) |
|
|
|
quads[i].href = link |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
browser.storage.sync.get("colors", function(result){ |
|
|
|
var quads = document.querySelectorAll('a') |
|
|
|
var style = document.createElement('style'); |
|
|
|
for (i = 0; i < quads.length; i++) { |
|
|
|
if (result.colors[i]) { |
|
|
|
style.appendChild( |
|
|
|
document.createTextNode('.content a:nth-child(' + (i + 1) + '):hover ~ svg polygon { fill: ' + result.colors[i] + '}') |
|
|
|
) |
|
|
|
if (result.colors) { |
|
|
|
var quads = document.querySelectorAll('a') |
|
|
|
var style = document.createElement('style'); |
|
|
|
for (i = 0; i < quads.length; i++) { |
|
|
|
if (result.colors[i]) { |
|
|
|
style.appendChild( |
|
|
|
document.createTextNode('.content a:nth-child(' + (i + 1) + '):hover ~ svg polygon { fill: ' + result.colors[i] + '}') |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
document.head.appendChild(style) |
|
|
|
} |
|
|
|
document.head.appendChild(style) |
|
|
|
}) |
|
|
|
browser.storage.sync.get("mode", function(result){ |
|
|
|
if (result.mode) { |
|
|
|