Mercurial > ec-userscripts
comparison cuffs-hulotte-popup.user.js @ 44:822ff5800f20
More updates
author | nanaya <me@nanaya.pro> |
---|---|
date | Thu, 24 Aug 2017 19:49:24 +0900 |
parents | f52f5727818f |
children | 5536da666361 |
comparison
equal
deleted
inserted
replaced
43:f52f5727818f | 44:822ff5800f20 |
---|---|
1 // ==UserScript== | 1 // ==UserScript== |
2 // @name Cuffs/Hulotte tuning | 2 // @name Cuffs/Hulotte tuning |
3 // @namespace https://myconan.net | 3 // @namespace https://myconan.net |
4 // @version 1.0.8 | 4 // @version 1.0.9 |
5 // @description Strip out Cuffs/Hulotte age confirmation popup, disables lightbox | 5 // @description Strip out Cuffs/Hulotte age confirmation popup, disables lightbox |
6 // @author nanaya | 6 // @author nanaya |
7 // @match http://www.cuffs.co.jp/* | 7 // @match http://www.cuffs.co.jp/* |
8 // @match http://www.cuffs-cube.jp/* | 8 // @match http://www.cuffs-cube.jp/* |
9 // @match http://hulotte.jp/* | 9 // @match http://hulotte.jp/* |
13 | 13 |
14 ;(function() { | 14 ;(function() { |
15 "use strict"; | 15 "use strict"; |
16 | 16 |
17 var $ = jQuery; | 17 var $ = jQuery; |
18 var rules = ''; | 18 var rules = []; |
19 var i; | |
20 var styleEl; | |
19 | 21 |
20 if (document.querySelector('#load_bg') != null) { | 22 if (document.querySelector('#load_bg') != null) { |
21 rules += ' #load_bg { display: none !important; } '; | 23 rules.push('#load_bg { display: none !important; }'); |
22 } | 24 } |
23 | 25 |
24 if (document.querySelector('body > #mainContent') != null) { | 26 if (document.querySelector('body > #mainContent') != null) { |
25 rules += ' body > :not(#mainContent) { display: none !important; } '; | 27 rules.push('body > :not(#mainContent) { display: none !important; }'); |
26 } | 28 } |
27 | 29 |
28 if (rules !== '') { | 30 for (i = 0; i < rules.length; i++) { |
29 var styleEl = document.createElement('style'); | 31 styleEl = document.createElement('style'); |
30 document.head.appendChild(styleEl); | 32 document.head.appendChild(styleEl); |
31 var styleSheet = styleEl.sheet; | 33 styleEl.sheet.insertRule(rules[i], 0); |
32 | |
33 styleSheet.insertRule( | |
34 rules, | |
35 styleSheet.cssRules.length | |
36 ); | |
37 } | 34 } |
38 | 35 |
39 $(function () { | 36 $(function () { |
40 $('.cboxElement').removeClass('cboxElement'); | 37 $('.cboxElement').removeClass('cboxElement'); |
41 }); | 38 }); |