annotate cuffs-hulotte-popup.user.js @ 117:d9dc190bccaf

Undo combining fixes into single script per site
author nanaya <me@nanaya.net>
date Sun, 15 Jan 2023 23:49:35 +0900
parents ef21ef445fc6
children 8de2d53a4cb1
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 */
117
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
17 const $ = jQuery;
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
18 const rules = [];
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
19 let i;
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
20 let styleEl;
45
5536da666361 More rules and be more confident 8D
nanaya <me@nanaya.pro>
parents: 44
diff changeset
21
117
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
22 if (document.querySelector('body > #mainContent') != null) {
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
23 rules.push('body > :not(#mainContent) { display: none !important; }');
109
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
24 }
ef21ef445fc6 Cleanups
nanaya <me@nanaya.net>
parents: 108
diff changeset
25
117
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
26 rules.push('#load_bg { display: none !important; }');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
27 rules.push('body > .modal { display: none !important; }');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
28 rules.push('body > div[style*="position: fixed"] { display: none !important; }');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
29
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
30 for (i = 0; i < rules.length; i++) {
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
31 styleEl = document.createElement('style');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
32 document.head.appendChild(styleEl);
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
33 styleEl.sheet.insertRule(rules[i], 0);
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
34 }
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
35
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
36 $(function () {
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
37 $('.cboxElement').removeClass('cboxElement');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
38 });
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
39
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
40 // force remove modal
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
41 $.cookie('modal', 'off');
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
42 if (typeof stopload === 'function') {
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
43 stopload();
d9dc190bccaf Undo combining fixes into single script per site
nanaya <me@nanaya.net>
parents: 109
diff changeset
44 }