Last active
August 4, 2022 14:58
-
-
Save niltok/7f5802ab3d5fc9c0ccecdcbebdd31050 to your computer and use it in GitHub Desktop.
知乎暗色脚本: add theme=dark to url automaticlly for zhihu
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 知乎暗色 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description add theme=dark to uri automaticlly | |
// @author Niltok | |
// @match https://*.zhihu.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=zhihu.com | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
if (!window.location.search.match('theme=dark')) { | |
if (window.location.search == "") | |
document.location.replace(window.location.href + '?theme=dark') | |
else document.location.replace(window.location.href + window.loaction.search + '&theme=dark') | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment