annotate cuffs-hulotte-popup.user.js @ 109:ef21ef445fc6

Cleanups - wrap everything in function and call them last - fix namespace and update url
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:33:41 +0900
parents 2c4470b73ad9
children d9dc190bccaf
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
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
3 // @namespace https://nanaya.net
82
86da34e62d29 Update url
nanaya <me@nanaya.pro>
parents: 77
diff changeset
4 // @version 1.1.6
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
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
11 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/cuffs-hulotte-popup.user.js
36
Edho Arief <me@nanaya.pro>
parents:
diff changeset
12 // ==/UserScript==
Edho Arief <me@nanaya.pro>
parents:
diff changeset
13
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
14 'use strict';
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
15
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
16 /* global jQuery, stopload */
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
17 function alwaysConsent () {
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
18 const $ = jQuery;
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
19 const rules = [];
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
20 let i;
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
21 let 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) {
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
24 rules.push('body > :not(#mainContent) { display: none !important; }');
66
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
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
27 rules.push('#load_bg { display: none !important; }');
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
28 rules.push('body > .modal { display: none !important; }');
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
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++) {
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
32 styleEl = document.createElement('style');
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
33 document.head.appendChild(styleEl);
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
34 styleEl.sheet.insertRule(rules[i], 0);
66
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 () {
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
38 $('.cboxElement').removeClass('cboxElement');
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
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
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
42 $.cookie('modal', 'off');
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
43 if (typeof stopload === 'function') {
108
2c4470b73ad9 Switch to semistandard
nanaya <me@nanaya.net>
parents: 85
diff changeset
44 stopload();
66
444b17e657be Standardize code style
nanaya <me@nanaya.pro>
parents: 58
diff changeset
45 }
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
46 }
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
47
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
48 alwaysConsent();