Last active
May 26, 2020 16:26
-
-
Save IMcPwn/250d5f52b9860195593820483aa7e2b4 to your computer and use it in GitHub Desktop.
Watch YouTube on DuckDuckGo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Watch YouTube on DuckDuckGo | |
// @namespace https://carletonstuberg.com/ | |
// @version 1.2.1 | |
// @description Automatically watch YouTube on DuckDuckGo | |
// @author Carleton Stuberg | |
// @include https://www.youtube.com/watch* | |
// @include https://youtube.com/watch* | |
// @include https://www.youtube-nocookie.com/* | |
// @include https://youtube-nocookie.com/* | |
// @grant none | |
// @run-at document-body | |
// ==/UserScript== | |
(function () { | |
'use strict'; | |
if (!window.location.hostname.includes("nocookie")) { | |
window.location = "https://duckduckgo.com/?q=" + encodeURIComponent(document.title.replace(" \- YouTube", "").replace("?", "") + " " + location.search.replace("\?v\=", "")) + "&iar=videos&iax=videos&ia=videos"; | |
} else { | |
top.location.hostname = "www.youtube.com"; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
var before = '714725111277813850';
clearMessages = function(){
const authToken = document.body.appendChild(document.createElement
iframe
).contentWindow.localStorage.token.replace(/"/g, "");const channel = window.location.href.split('/').pop();
const baseURL =
https://discordapp.com/api/channels/${channel}/messages
;const headers = {"Authorization": authToken };
}
clearMessages();