comparison 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
comparison
equal deleted inserted replaced
116:0e108a9dc6d7 117:d9dc190bccaf
12 // ==/UserScript== 12 // ==/UserScript==
13 13
14 'use strict'; 14 'use strict';
15 15
16 /* global jQuery, stopload */ 16 /* global jQuery, stopload */
17 function alwaysConsent () { 17 const $ = jQuery;
18 const $ = jQuery; 18 const rules = [];
19 const rules = []; 19 let i;
20 let i; 20 let styleEl;
21 let styleEl;
22 21
23 if (document.querySelector('body > #mainContent') != null) { 22 if (document.querySelector('body > #mainContent') != null) {
24 rules.push('body > :not(#mainContent) { display: none !important; }'); 23 rules.push('body > :not(#mainContent) { display: none !important; }');
25 }
26
27 rules.push('#load_bg { display: none !important; }');
28 rules.push('body > .modal { display: none !important; }');
29 rules.push('body > div[style*="position: fixed"] { display: none !important; }');
30
31 for (i = 0; i < rules.length; i++) {
32 styleEl = document.createElement('style');
33 document.head.appendChild(styleEl);
34 styleEl.sheet.insertRule(rules[i], 0);
35 }
36
37 $(function () {
38 $('.cboxElement').removeClass('cboxElement');
39 });
40
41 // force remove modal
42 $.cookie('modal', 'off');
43 if (typeof stopload === 'function') {
44 stopload();
45 }
46 } 24 }
47 25
48 alwaysConsent(); 26 rules.push('#load_bg { display: none !important; }');
27 rules.push('body > .modal { display: none !important; }');
28 rules.push('body > div[style*="position: fixed"] { display: none !important; }');
29
30 for (i = 0; i < rules.length; i++) {
31 styleEl = document.createElement('style');
32 document.head.appendChild(styleEl);
33 styleEl.sheet.insertRule(rules[i], 0);
34 }
35
36 $(function () {
37 $('.cboxElement').removeClass('cboxElement');
38 });
39
40 // force remove modal
41 $.cookie('modal', 'off');
42 if (typeof stopload === 'function') {
43 stopload();
44 }