annotate cuffs-hulotte-popup.user.js @ 81:e30cd7fbee42

Actually working
author nanaya <me@nanaya.pro>
date Sat, 03 Oct 2020 02:21:56 +0900
parents 5a3a269c5e6f
children 86da34e62d29
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
77
5a3a269c5e6f Update downloadurl
nanaya <me@nanaya.pro>
parents: 73
diff changeset
4 // @version 1.1.5
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
77
5a3a269c5e6f Update downloadurl
nanaya <me@nanaya.pro>
parents: 73
diff changeset
11 // @downloadURL https://hg.sr.ht/~nanaya/ec-userscripts/raw/cuffs-hulotte-popup.user.js?rev=tip
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
12 // ==/UserScript==
Edho Arief <me@nanaya.pro>
parents:
diff changeset
13
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
14 /* global jQuery, stopload */
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
15 ;(function () {
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
16 'use strict'
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
17
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
18 var $ = jQuery
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
19 var rules = []
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
20 var i
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
21 var styleEl
43
f52f5727818f More rules for cuffs
nanaya <me@nanaya.pro>
parents: 42
diff changeset
22
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
23 if (document.querySelector('body > #mainContent') != null) {
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
24 rules.push('body > :not(#mainContent) { display: none !important; }')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
25 }
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
26
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
27 rules.push('#load_bg { display: none !important; }')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
28 rules.push('body > .modal { display: none !important; }')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
29 rules.push('body > div[style*="position: fixed"] { display: none !important; }')
45
5536da666361 More rules and be more confident 8D
nanaya <me@nanaya.pro>
parents: 44
diff changeset
30
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
31 for (i = 0; i < rules.length; i++) {
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
32 styleEl = document.createElement('style')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
33 document.head.appendChild(styleEl)
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
34 styleEl.sheet.insertRule(rules[i], 0)
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
35 }
38
Edho Arief <me@nanaya.pro>
parents: 37
diff changeset
36
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
37 $(function () {
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
38 $('.cboxElement').removeClass('cboxElement')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
39 })
47
bc45afe111d8 Das cute
nanaya <me@nanaya.pro>
parents: 46
diff changeset
40
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
41 // force remove modal
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
42 $.cookie('modal', 'off')
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
43 if (typeof stopload === 'function') {
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
44 stopload()
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
45 }
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
46 }).call()