Search code examples
greasemonkey

Greasemonkey remove a var in div


I'm trying to remove overflow:hidden or change it with :visible in this line:

<div style="width:75px;height:95px;padding:7px;overflow:hidden;background:#fff;border:3px solid gray;border-radius:10px;">

I've tried with var overflow = visible; didn't help.


Solution

  • Standard JavaScript, one div for simplicity:

    document.querySelector('div[style*="overflow:hidden"]').style.overflow = 'visible';
    

    jQuery, any number of divs, needs @require meta-property:

    // ==UserScript==
    .........................
    // @require https://code.jquery.com/jquery-2.2.4.min.js
    // ==/UserScript==
    
    $('div[style*="overflow:hidden"]').css('overflow', 'visible');
    

    Or simply use Stylish extension with the following CSS:

    div[style*="overflow:hidden"] { overflow:visible!important }