annotate cuffs-hulotte-popup.user.js @ 43:f52f5727818f

More rules for cuffs
author nanaya <me@nanaya.pro>
date Thu, 24 Aug 2017 04:11:29 +0900
parents 456614d0a9ca
children 822ff5800f20
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
1 // ==UserScript==
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
2 // @name Cuffs/Hulotte tuning
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
3 // @namespace https://myconan.net
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
4 // @version 1.0.8
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
5 // @description Strip out Cuffs/Hulotte age confirmation popup, disables lightbox
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
6 // @author nanaya
Edho Arief <me@nanaya.pro>
parents:
diff changeset
7 // @match http://www.cuffs.co.jp/*
41
1ca21c3adcf0 Add more sites
nanaya <me@nanaya.pro>
parents: 40
diff changeset
8 // @match http://www.cuffs-cube.jp/*
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
9 // @match http://hulotte.jp/*
Edho Arief <me@nanaya.pro>
parents:
diff changeset
10 // @grant none
Edho Arief <me@nanaya.pro>
parents:
diff changeset
11 // @downloadURL https://bitbucket.org/!api/2.0/snippets/nanayapro/TK64/tip/files/cuffs-hulotte-popup.user.js
Edho Arief <me@nanaya.pro>
parents:
diff changeset
12 // ==/UserScript==
Edho Arief <me@nanaya.pro>
parents:
diff changeset
13
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
14 ;(function() {
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
15 "use strict";
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
16
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
17 var $ = jQuery;
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
18 var rules = '';
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
19
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
20 if (document.querySelector('#load_bg') != null) {
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
21 rules += ' #load_bg { display: none !important; } ';
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
22 }
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
23
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
24 if (document.querySelector('body > #mainContent') != null) {
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
25 rules += ' body > :not(#mainContent) { display: none !important; } ';
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
26 }
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
27
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
28 if (rules !== '') {
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
29 var styleEl = document.createElement('style');
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
30 document.head.appendChild(styleEl);
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
31 var styleSheet = styleEl.sheet;
40
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
32
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
33 styleSheet.insertRule(
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
34 rules,
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
35 styleSheet.cssRules.length
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
36 );
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
37 }
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
38
42
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
39 $(function () {
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
40 $('.cboxElement').removeClass('cboxElement');
456614d0a9ca Remove lightbox as well
nanaya <me@nanaya.pro>
parents: 41
diff changeset
41 });
40
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
42 }).call();