Commit 40326b8b authored by soup-bowl's avatar soup-bowl
Browse files

Displays bookmarks from the Bookmarks Bar.

parent ddde9436
......@@ -8,3 +8,6 @@ Nutab replaces the new tab page with a beautiful daily photograph, sourced from
### Permissions
#### Bookmarks
Similar to the default new tab page, this extension will bring you access to your bookmarks. For Nutab to access your bookmarks, Nutab requests bookmarks permission access to read and display your bookmarks. The extension will not make modifications to your bookmarks.
### Icons
To add a touch of style to bookmarks, the bookmarks bar is represented by icons without labels. It can happen that bookmarked sites are familiarised by their icons, thus speeding up navigation. For the extension to have the ability to display these icons, this permission is requested from you. It will only ever grab the icon of the relative bookmark.
\ No newline at end of file
body{background-image:url("https://source.unsplash.com/random");background-size:cover;margin:0;padding:0;width:100%;height:100%;color:#f6f6f6;text-shadow:0 0 25px #000;display:table;font-weight:100;font-family:sans-serif}.container{text-align:center;display:table-cell;vertical-align:middle}.container .content{text-align:center}.container .content .title{font-size:96px;margin-bottom:40px}
\ No newline at end of file
body{background-image:url("https://source.unsplash.com/random");background-size:cover;margin:0;padding:0;width:100%;height:100%;color:#f6f6f6;text-shadow:0 0 25px #000;display:table;font-weight:100;font-family:sans-serif}.container{text-align:center;display:table-cell;vertical-align:middle}.container .content{text-align:center}.container .content .title{font-size:96px;margin-bottom:25px}.container .content .subtitle{font-size:32px;margin-bottom:40px}#bookmarksbar li{display:inline;margin:0 .2em 0 .2em}
\ No newline at end of file
{"version":3,"sources":["newtab.css"],"names":[],"mappings":"AAEA,KACI,qBAAsB,qCAAtB,CACA,qBAAA,CAEA,QAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CACA,aAAA,CACA,yBAAA,CACA,aAAA,CACA,eAAA,CACA,uBAGJ,WACI,iBAAA,CACA,kBAAA,CACA,sBAHJ,UAKI,UACI,kBANR,UAKI,SAGI,QACI,cAAA,CACA"}
\ No newline at end of file
{"version":3,"sources":["newtab.css"],"names":[],"mappings":"AAEA,KACI,qBAAsB,qCAAtB,CACA,qBAAA,CAEA,QAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CACA,aAAA,CACA,yBAAA,CACA,aAAA,CACA,eAAA,CACA,uBAGJ,WACI,iBAAA,CACA,kBAAA,CACA,sBAHJ,UAKI,UACI,kBANR,UAKI,SAGI,QACI,cAAA,CACA,mBAVZ,UAKI,SAQI,WACI,cAAA,CACA,mBAKZ,aACI,IACI,cAAA,CACA"}
\ No newline at end of file
......@@ -5,9 +5,17 @@
</head>
<body>
<div class="container">
<div class="content">
<div class="bookmarksbar">
<ul id="bookmarksbar"></ul>
</div>
</div>
<div class="content">
<div class="title">Welcome</div>
<div class="subtitle">Start typing to search</div>
</div>
</div>
<script src="../js/bookmarks.js"></script>
<script src="../js/translation.js"></script>
</body>
\ No newline at end of file
var bmk = chrome.bookmarks; // Chrome bookmarks shorthand
document.addEventListener("DOMContentLoaded", function(event) {
displayBookmarks();
});
function displayBookmarks() {
// "1" being the Bookmarks Bar, grab the bookmark tree.
bmk.getSubTree("1", function(e) {
var bookmarkBar = document.getElementById("bookmarksbar");
// Iterate through the bookmark nodes.
e[0].children.forEach(function(bookmark) {
// TODO - Support folders. For now, skip them.
if (bookmark.children !== undefined)
return;
var bookmarkEntry = document.createElement("LI"); // Container
var bookmarkLink = document.createElement("A"); // Hyperlink
var bookmarkIcon = document.createElement("IMG"); // Favicon
bookmarkLink.setAttribute("href", bookmark.url);
bookmarkIcon.setAttribute("src", "chrome://favicon/" + bookmark.url);
bookmarkLink.appendChild(bookmarkIcon);
bookmarkEntry.appendChild(bookmarkLink);
bookmarkBar.appendChild(bookmarkEntry);
});
});
}
\ No newline at end of file
......@@ -25,7 +25,19 @@ body {
.title {
font-size: 96px;
margin-bottom: 25px;
}
.subtitle {
font-size: 32px;
margin-bottom: 40px;
}
}
}
#bookmarksbar {
li {
display:inline;
margin: 0 0.2em 0 0.2em;
}
}
\ No newline at end of file
......@@ -24,6 +24,7 @@
"default_title": "__MSG_appName__"
},
"permissions": [
"bookmarks"
"bookmarks",
"chrome://favicon/"
]
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment