Mercurial > ec-userscripts
annotate cuffs-hulotte-popup.user.js @ 130:49658e99888a
[medium] update class name and use document level styling instead
author | nanaya <me@nanaya.net> |
---|---|
date | Sun, 26 Feb 2023 20:09:37 +0900 |
parents | 8de2d53a4cb1 |
children |
rev | line source |
---|---|
36 | 1 // ==UserScript== |
118 | 2 // @name Cuffs/Hulotte tuning |
3 // @namespace https://nanaya.net | |
4 // @version 1.1.6 | |
5 // @description Strip out Cuffs/Hulotte age confirmation popup, disables lightbox | |
6 // @author nanaya | |
7 // @match http://www.cuffs.co.jp/* | |
8 // @match http://www.cuffs-cube.jp/* | |
9 // @match http://hulotte.jp/* | |
10 // @grant none | |
11 // @downloadURL https://hg.nanaya.net/ec-userscripts/raw-file/tip/cuffs-hulotte-popup.user.js | |
36 | 12 // ==/UserScript== |
13 | |
109 | 14 'use strict'; |
15 | |
66 | 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 | 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 | 24 } |
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 } |