# HG changeset patch # User nanaya # Date 1503571764 -32400 # Node ID 822ff5800f20cce01f62150666446daa0649a909 # Parent f52f5727818f633476ca1da644aa3e04bbe0653c More updates diff -r f52f5727818f -r 822ff5800f20 cuffs-hulotte-popup.user.js --- a/cuffs-hulotte-popup.user.js Thu Aug 24 04:11:29 2017 +0900 +++ b/cuffs-hulotte-popup.user.js Thu Aug 24 19:49:24 2017 +0900 @@ -1,7 +1,7 @@ // ==UserScript== // @name Cuffs/Hulotte tuning // @namespace https://myconan.net -// @version 1.0.8 +// @version 1.0.9 // @description Strip out Cuffs/Hulotte age confirmation popup, disables lightbox // @author nanaya // @match http://www.cuffs.co.jp/* @@ -15,25 +15,22 @@ "use strict"; var $ = jQuery; - var rules = ''; + var rules = []; + var i; + var styleEl; if (document.querySelector('#load_bg') != null) { - rules += ' #load_bg { display: none !important; } '; + rules.push('#load_bg { display: none !important; }'); } if (document.querySelector('body > #mainContent') != null) { - rules += ' body > :not(#mainContent) { display: none !important; } '; + rules.push('body > :not(#mainContent) { display: none !important; }'); } - if (rules !== '') { - var styleEl = document.createElement('style'); + for (i = 0; i < rules.length; i++) { + styleEl = document.createElement('style'); document.head.appendChild(styleEl); - var styleSheet = styleEl.sheet; - - styleSheet.insertRule( - rules, - styleSheet.cssRules.length - ); + styleEl.sheet.insertRule(rules[i], 0); } $(function () {