Prevent js file from running

0

I would like to know how to prevent or modify a .js file from a website when it is run in my browser. The site has the following code

<script type="text/javascript" src="scripts/play.html.js?_v=1.1.1">

This script play.html.js, causes when a video on the page loses focus, it pauses. Every time I flip the window it changes the body attribute from <body class="visible"> to <body class="hidden"> , I use two monitors on my pc, and I would like to leave the video playing on one monitor while I move on the other.

How can I change this site's role?

    
asked by anonymous 28.02.2014 / 18:07

1 answer

2

You can make a user script to change how the site works by using the Greasemonkey (if you use Firefox) or Tampermonkey (if you use Chrome), you should revert what play.html.js does, with something like:

var body = document.getElementsByTagName('body')[0];
var classes = body.className.split(' ');
if (classes.indexOf('hidden') >= 0){
    classes.pop('hidden');
    classes.push('visible');
    body.className = classes.join(' ');
}

You probably need to make some modification to this script, limit it to run only on the domain and on the correct page, but the path is that.

    
28.02.2014 / 18:26