+5
README.md
+5
README.md
+13
-3
pinnedbookmarklets.uc.js
+13
-3
pinnedbookmarklets.uc.js
···
1
-
const sidebarBoxes = document.querySelectorAll('.workspace-arrowscrollbox');
2
-
const bookmarklets = document.getElementById('PlacesToolbarItems').querySelectorAll('toolbarbutton[scheme="javascript"]');
3
-
sidebarBoxes.forEach((box) => {
1
+
// ==UserScript==
2
+
// @name pinnedbookmarklets.uc.js
3
+
// @description Puts your bookmarklets in the top of the sidebar.
4
+
// @author Carly Smallbird
5
+
// @version v1.0
6
+
// @include main
7
+
// @grant none
8
+
// ==/UserScript==
9
+
10
+
const sidebarBoxes = document.querySelectorAll('.workspace-arrowscrollbox'); // gets all sidebars
11
+
const bookmarklets = document.getElementById('PlacesToolbarItems').querySelectorAll('toolbarbutton[scheme="javascript"]'); // filters bookmarks toolbar for bookmarklets
12
+
sidebarBoxes.forEach((box) => { // creates a new box in each sidebar to put the bookmarks in
4
13
const newVbox = document.createElement('vbox');
5
14
newVbox.classList.add('zen-workspace-bookmarklets-section');
6
15
bookmarklets.forEach((b) => {
7
16
newVbox.append(b);
8
17
});
18
+
sidebarBoxes.prepend(newVbox); // adds the bookmarklets
9
19
});