annotate cuffs-hulotte-popup.user.js @ 40:23c1810da164

Only if there's main content
author nanaya <me@nanaya.pro>
date Thu, 20 Jul 2017 20:29:43 +0900
parents c994d0e076a3
children 1ca21c3adcf0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
1 // ==UserScript==
Edho Arief <me@nanaya.pro>
parents:
diff changeset
2 // @name Cuffs/Hulotte popup disable
Edho Arief <me@nanaya.pro>
parents:
diff changeset
3 // @namespace https://myconan.net
40
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
4 // @version 1.0.4
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
5 // @description Strip out Cuffs/Hulotte age confirmation popup
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/*
Edho Arief <me@nanaya.pro>
parents:
diff changeset
8 // @match http://hulotte.jp/*
Edho Arief <me@nanaya.pro>
parents:
diff changeset
9 // @grant none
Edho Arief <me@nanaya.pro>
parents:
diff changeset
10 // @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
11 // ==/UserScript==
Edho Arief <me@nanaya.pro>
parents:
diff changeset
12
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
13 ;(function() {
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
14 "use strict";
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
15
40
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
16 if (document.querySelector('body > #mainContent') == null) {
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
17 return;
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
18 }
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
19
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
20 var styleEl = document.createElement('style');
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
21 document.head.appendChild(styleEl);
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
22 var styleSheet = styleEl.sheet;
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
23
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
24 styleSheet.insertRule(
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
25 'body > :not(#mainContent) { display: none !important; }',
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
26 styleSheet.cssRules.length
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
27 );
40
23c1810da164 Only if there's main content
nanaya <me@nanaya.pro>
parents: 39
diff changeset
28 }).call();