# HG changeset patch # User nanaya # Date 1500550183 -32400 # Node ID 23c1810da1643295b6187721433b1d5061d9632e # Parent c994d0e076a3b78bcda831a94a7161677df7015e Only if there's main content diff -r c994d0e076a3 -r 23c1810da164 cuffs-hulotte-popup.user.js --- a/cuffs-hulotte-popup.user.js Thu Jul 20 09:11:13 2017 +0000 +++ b/cuffs-hulotte-popup.user.js Thu Jul 20 20:29:43 2017 +0900 @@ -1,7 +1,7 @@ // ==UserScript== // @name Cuffs/Hulotte popup disable // @namespace https://myconan.net -// @version 1.0.3 +// @version 1.0.4 // @description Strip out Cuffs/Hulotte age confirmation popup // @author nanaya // @match http://www.cuffs.co.jp/* @@ -13,6 +13,10 @@ ;(function() { "use strict"; + if (document.querySelector('body > #mainContent') == null) { + return; + } + var styleEl = document.createElement('style'); document.head.appendChild(styleEl); var styleSheet = styleEl.sheet; @@ -21,4 +25,4 @@ 'body > :not(#mainContent) { display: none !important; }', styleSheet.cssRules.length ); -}).call(); \ No newline at end of file +}).call();