View difference between Paste ID: 1PuTZKgc and E83UcDzT
SHOW: | | - or go back to the newest paste.
1
// ==UserScript==
2
// @name templateUserJS
3
// @description Chrome userjs template
4
// @author Anonymous
5
// @license MIT
6
// @version 1.0
7
// @include *://2ch.hk/*
8
// @match *://2ch.hk/*
9
// @run-at document-end
10
// ==/UserScript==
11
12
(function(wnd) {
13
14-
    'use strict';
14+
    "use strict";
15
16
    var w;
17
18
19-
    if(typeof unsafeWindow != 'undefined')
19+
    if(typeof unsafeWindow != "undefined")
20
        w = unsafeWindow;
21
    else
22
        w = wnd;
23
24
    // Не запускаем скрипт во фреймах
25
    // без этого условия скрипт будет запускаться несколько раз на странице с фреймами
26
    if(w.self != w.top)
27
        return;
28
29
    // Дополнительная проверка наряду с @include
30-
    if(location.hostname !== '2ch.hk')
30+
    if(location.hostname !== "2ch.hk")
31
        return;
32
33
    if(/http.*:\/\/2ch.hk/.test(w.location.href)) {
34
35
        //Ниже идёт непосредственно код скрипта
36-
        alert('Userscripts приветствует вас навязчивым окном.');
36+
        alert("Userscripts приветствует вас навязчивым окном.");
37-
        GM_addStyle('html, body {background-color: #FFFFFF !important;background-repeat: no-repeat;} body {font-family: "Courier", "Courier New", monospace;font-size:12pt;color: #333333;} .posts {font-family: Courier, "Courier New", monospace;font-size: 11pt;overflow-x: hidden;} .header a.mainlogo {   } .header .welcomefriend {color: #d9d9d9;} ul.menu-links-mob a {text-decoration: none;} .hboardlist li b {color: #333333;} .table .thead .th {background: #555555;color: #dddddd;} .qr {background: white !important;} .thread {margin: auto;min-width: 66%;max-width: 66%;} .post-wrapper, .oppost-wrapper {margin: 4px auto;} .oppost-wrapper {background: white !important;border: solid 1px #CCCCCC;border-radius: 0 !important;} .reply, .reply.withimg, .post {background: white !important;border: solid 1px #CCCCCC;border-radius: 0 !important; min-width: 100%;max-width: 100%;text-align: justify;} .oppost {border: none;} .reply-label, a, .a-link-emulator {color: #888888 !important;text-decoration: none;} span.spoiler:hover {color: #333333;} span.spoiler {background: #CCCCCC;color: #CCCCCC;} #adminbar {font-family: "Courier", "Times New Roman", "serif";font-size: 12px;color: #666666;} .board-tags, .board-tags + hr {display: none;} .moneymoneymoney {display: none;} .favorites, .boardstats {display: none;} .de-thr-hid {display: block;margin: auto;min-width: 66%;max-width: 66%;} .de-pview {min-width: 0;}');
37+
        GM_addStyle("body {color:white; background-color:black;}");
38
    }
39
40
})(window);