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hY+LYA
-HbmP1sTkWluH/Qq+P1wtTrILtPGBvmw6ddFg5DOSnKvFUcLC2tSHsjNCm9TgJFqb
-LAW7aa8oJwKBgG4er5V/hAkdwynAtcIInILQeprLPMP6QtHS0xazSxhXAv8wcY1y
-KAmAa+LyF2khymxKWB4UCi7uSjcA3MZIlwrSkNMzse9VWewNatbJEzuup27hdEPN
-2VvqMUduMj4Q1WKV4fdjUWVmMizSPyP22ahJJNoO2uL/kFKgDFVjxxShAoGBAIqO
-HO0fvWQQFb5wn5EUxyfTpv3Zqh3S7RWiLemTkmrajnuHyVM/HY1hYHydUadtnBYQ
-gThp4nyEr6jkrfW9Dj83K6wvHQ9YOb3GrA0bOGpQQsTxjfcd3qa+SfKQis4ZPIfW
-NfZ0RjI61PjtVd1Im0DXtYM8btjODEZ1NbPLmtIfAoGAeIOZneR8SvcDkv/NgYtN
-4xt9ftcbGwIWgjgar9diSgOUgOUDEk0AAkx+CNNYVBJf6eYZdc71I2sBumNqKcE4
-+TJzYywWQvEmRudg2kapZcNYMVZUNU+1+MEtvKn8f8q0istXr5+Lhb5PE+yBcirt
-kwdy2Y0qIBaUnJwx8jNhT+o=
------END PRIVATE KEY-----
var hoverbg2 = "#848ead";
var editMode = false;
var dragSrcEl = null;
+var thumbServer = "https://www.google.com/s2/favicons?domain=";
var defaultColumns= [
["General",
["Github", "https://github.com"],
}
}
+
function genColumn(title) {
// Generate HTML elements for a column (without items)
}
+
function genItem(ul, nme, url) {
// Generate HTML elements for an item
li.setAttribute("class", ul.id + "-" + (ul.getElementsByTagName("li").length + 1).toString() );
li.addEventListener("mouseup", saveConfig);
- var img = document.createElement("img");
- img.className = "icon";
- img.src = "https://www.google.com/s2/favicons?domain=" + url;
+ var img = requestThumbnail(url);
var link = document.createElement("a");
link.className = "item";
}
+function requestThumbnail(imageUrl) {
+ // Get thumbnail from Google's favicon server
+ var img = document.createElement("img");
+ var xhr = new XMLHttpRequest();
+ xhr.open('GET', thumbServer + imageUrl);
+ xhr.responseType = "blob";
+ xhr.onload = function() {
+ img.setAttribute("data-src", thumbServer + imageUrl);
+ img.className = "icon";
+ var objUrl = URL.createObjectURL(xhr.response);
+ img.setAttribute("src", objUrl);
+ }.bind(this);
+ xhr.send();
+ return img;
+}
+
+
// --------------------------------
//
// Edit mode
"content_security_policy": "script-src 'self'; object-src 'self'",
"manifest_version": 2,
"name": "newtab",
+ "description": "A simple new tab page with customisable links",
"options_ui": {
"chrome_style": true,
"page": "options.html"
},
- "permissions": [ "management", "storage"],
- "version": "1"
+ "permissions": [ "storage" ],
+ "version": "2"
}