-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddQuicks.js
42 lines (32 loc) · 1.17 KB
/
AddQuicks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// ==UserScript==
// @name AddQuicks
// @namespace http://tampermonkey.net/
// @version 03
// @description Add quick links to the google homepage.
// @author Dor Fibert
// @match https://www.google.com/
// @include https://www.google.com/*
// @include https://www.google.co.il/*
// @exclude https://www.google.com/search*
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.slim.min.js
// ==/UserScript==
(function() {
'use strict';
var quicks = [['YouTube','https://www.youtube.com/?gl=IL'],
['Twitch', 'https://www.twitch.tv/'],
['Drive','https://drive.google.com/drive/'],
['Netflix','https://www.netflix.com']
];
$(document).ready(function() {
var gmailDiv = $("div>a:contains('Gmail')").parent();
var navBar = gmailDiv.parent();
var divToAdd=gmailDiv.clone();
divToAdd.children().removeAttr("data-pid");
quicks.forEach(function(q){
var tmpDiv = divToAdd.clone();
tmpDiv.children().text(q[0]).attr("href",q[1]);
navBar.prepend(tmpDiv);
});
})
})();