Bookmarklet to remove cookiewall.
Tries to find and remove backdrop/overlay, and popup box.
Also attempts to restore body scrolling if needed
(body.style.overflow='hidden' sometimes prevents scrolling)
After it is done you can abort and undo, or click bookmark again later to undo.
Seems to work on a few sites, but haven't tested many yet.
<pre>
Bookmarklet to remove cookiewall.
Tries to find backdrop/overlay, and popup box.
When elements have been found with a high enough probability,
they will be hidden (display:none).
Also attempts to restore body scrolling if needed
(body.style.overflow='hidden' sometimes prevents scrolling)
After it is done you can click bookmark again to undo if needed (if things break).
Seems to work on a few sites, but haven't tested many yet.
</pre>
<hr>
drag to bookmarks bar:
<a href="javascript: (function(){ let backdrops = []; let popups = []; function init() { if (isUndoAvailable()) { if (confirm('Undo remove cookiewall?')) { executeUndo(); } return; } Array.from(document.querySelectorAll('*')).forEach( (el) => { let backdropProbability = getBackdropProbability(el); if (backdropProbability > 100) { backdrops.push({ el: el, backdropProbability: backdropProbability }); } let popupProbability = getPopupProbability(el); if (popupProbability > 100) { popups.push({ el: el, popupProbability: popupProbability }); } }); if (!backdrops.length && !popups.length) { return; } backdrops.sort( (a, b) => { if (a.backdropProbability == b.backdropProbability) { return 0; } return a.backdropProbability > b.backdropProbability ? -1 : 1; }); popups.sort( (a, b) => { if (a.popupProbability == b.popupProbability) { return 0; } return a.popupProbability > b.popupProbability ? -1 : 1; }); if (backdrops[0] && popups[0] && backdrops[0].el === popups[0].el) { popups.shift(); } var backdrop = backdrops[0] ? (backdrops[0]).el : null; var popup = popups[0] ? (popups[0]).el : null; var undo = window.remove_cookiewall_undo = { elements: [] }; undo.elements.push({ el: document.body, style: {overflow: document.body.style.overflow}, }); if (document.body.style.overflow === 'hidden') { document.body.style.overflow = 'auto'; } if (backdrop) { undo.elements.push({ el: backdrop, style: {display:...
CSS
/*
CSS panel unused, just some comments and examples here...
Some example test urls with cookiewall popups:
(use incognito mode to make it appear again if you accepted it before, or clear cookies)
https://thegimptutorials.com/how-to-make-gif/
https://opensource.com/article/19/12/help-bash-program
https://www.linuxquestions.org/questions/debian-26/stopping-a-runaway-script-4175462991/
Example html + css layout of cookiewalls:
https://opensource.com/article/19/12/help-bash-program
body
<div id="pop-div06818956343113329" class="truste_overlay"></div>
.truste_overlay {
background-color: #000;
opacity: 0.4;
position: fixed;
z-index: 1000010;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
overflow: hidden;
filter: Alpha(Opacity: 80);
}
<div id="pop-div205702627587266527" class="truste_box_overlay">
.truste_box_overlay {
position: absolute;
z-index: 2000010;
top: 0px;
left: 0px;
bottom: 0px;
right: 0px;
border-radius: 5px;
padding: 10px;
width: 80%;
max-width: 829px;
height: var(--truste-box-overlay-height);
min-width: 220px;
margin: 20px auto 20px var(--truste-box-overlay-margin-left);
box-sizing: content-box;
padding: 0px;
border-radius: 3px;
margin: 20px auto !important;
}
https://www.linuxquestions.org/questions/debian-26/stopping-a-runaway-script-4175462991/
body
<div class="fc-consent-root">
<div class="fc-dialog-overlay"></div>
<div class="fc-dialog-container">...</div>
<div class="fc-help-dialog-container" role="dialog" tabindex="0" style="display: none !important;">
<div class="fc-help-dialog-overlay"></div>
<div class="fc-help-dialog">...</div>
</div>
</div>
div.fc-consent-root {
position: fixed !important;
z-index: 2147483644 !important;
align-items:...
JavaScript
// DEBUG RETURN THROW ERROR temp disabled so code does not run on startup in jsfiddle
// DEBUG RETURN THROW ERROR temp disabled so code does not run on startup in jsfiddle
return; throw new Error('dont run in jsfiddle'); // remove me for bookmarklet
// DEBUG RETURN THROW ERROR temp disabled so code does not run on startup in jsfiddle
// DEBUG RETURN THROW ERROR temp disabled so code does not run on startup in jsfiddle
// To convert all code below into a bookmarklet, see:
// https://jsfiddle.net/ElMoonLite/ndg24dso/ -- convert javascript into a bookmarklet
// (copy all this JS here in the "Input" field there)
/*
remove cookiewall bookmarklet
- look for and remove: backdrop or overlay
- look for and remove: popup box
- fix original content: e.g. fix scrolling or blur or opacity etc.
- support preview or undo
- start out strict, but allow lose matching using (sorting on) probability?
indicators an element might be a backdrop/overlay or popup:
- backdrop/overlay:
usually a full window size container (width: 100% height 100%)
position: fixed or absolute,
often but not always direct child of document.body
often black with opacity < 1,
or background #000 with alpha < 1
very high z-index
overflow: hidden
top: 0px
left: 0px
bottom: 0px
right: 0px
- popup box:
element usually the next sibling of backdrop.
sometimes popup is a child of the backdrop/overlay.
very high z-index, above backdrop z-index.
position often somewhere in the middle.
or at the top or bottom, and full window width, or horizontally centered.
- document.body:
sometimes scrolling is prevented, by using e.g. overflow: hidden, set back to overflow: auto
TODO: run tests on more sites, and clean up code a bit.
*/
//javascript:
(function(){
let backdrops = [];
let popups = [];
function init() {
if (isUndoAvailable()) {
if (confirm('Undo remove cookiewall?')) {
executeUndo();
}
return;
}
// Probability ranges from 0-1000 ish.
// The chances of having...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.