Preventing flash videos from automatically starting.

Discussion in 'Discussion (Adguard for Windows)' started by streetwolf, Apr 15, 2014.

  1. streetwolf

    streetwolf Beta Tester

    Joined:
    Apr 9, 2014
    Messages:
    500
    Perhaps what I'm looking to accomplish is beyond the scope of AG but I'll describe what I want to do.

    Some sites that I visit a flash video will play automatically. cnn.com has lots of these. Here's an example:

    NFL 'Disturbed' by Aldon Smith Arrest, 'Significant Suspension' Could Be Coming | Bleacher Report

    I tried FlashBlock but I don't want to block everything. Firefox's built in flash plugin blocker doesn't cut the mustard either.

    Even if AG can't do what I outlined perhaps someone knows another method.
     
  2. WebRat

    WebRat Beta Tester

    Joined:
    Apr 13, 2014
    Messages:
    24
    Have you tried NoScript add-on for Firefox?
     
  3. streetwolf

    streetwolf Beta Tester

    Joined:
    Apr 9, 2014
    Messages:
    500
    NoScript I always felt was overkill. Block everything and only let through the stuff you want. Makes the Internet much less useful.

    Unless there is a way with NS that I can just do what I want to do with flash videos then I might give it a go,.
     
  4. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    This is something i would like for a few sites too, on load buffer the video rather than autoplay it from the start but, im not sure how to achieve this, im guessing you would need greasemonkey and javascript knowledge but like i said im unsure.
     
  5. streetwolf

    streetwolf Beta Tester

    Joined:
    Apr 9, 2014
    Messages:
    500
    Most sites have the play arrow over the video. I have no problems with these. If I want to play them I click on the arrow. It's those annoying videos that play automatically that irks me to no end. Often they are accompanied by text which I prefer to read as opposed to watching/listening to a video.

    If what I want is possible it would have to be site specific.
     
  6. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    I know what you mean, this is why im thinking greasemonkey and javascript as you can change layouts etc so i believe you could add code telling the video to pause on load but, dont quote me on that.

    I did notice my adguard inspector didnt work on that site and there was an annoying pop up that i could get rid of maybe i need sleep though lol
     
  7. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    12,446
    It looks like you need FlashBlock disabled everywhere except these sites.

    I can create some rules for you that do the thing, but they are very specific.

    For example, rule for bleacher report:
    Code:
    bleacherreport.com#%#document.addEventListener('ooyalaLoaded', function() { BR.UA = null; });
    
     
  8. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Thats cool!
    Unfortuinatly there isn't much info on javascript injection yet, even then would have to figure out how to do them i guess.
     
  9. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    12,446
    Javascript injections are simple, just look at the rule above.
    The code after rule mark #%# will be added to the document's head.
     
  10. Nameless

    Nameless Beta Tester

    Joined:
    Mar 19, 2014
    Messages:
    723
    Everything is simple when you know how avatar lol but right now the documentation on injection is very limited with one example which does not make much sense to me but i'll look into javascript when im not browsing the internet, i take it i could change an element via adguard doing thenis then?

    Say for example a flash video has autoplay=true could i change that to false?

    Also is the injection rules limited in anyway like the extension rules are.
     
  11. avatar

    avatar Administrator Staff Member Administrator

    Joined:
    Oct 26, 2010
    Messages:
    12,446
    You can with one but - you should use pure javascript (plus you can use libs from the page javascript was injected to).

    It is not that simple. You can try but you should do it in the right time.
     
  12. streetwolf

    streetwolf Beta Tester

    Joined:
    Apr 9, 2014
    Messages:
    500