Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts

    Disable download button

    I show a youtube video on my website and IDM (internet download manager) put a download buton on it.
    How can I prevent the IDM download button ? Thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,151
    Thanks
    203
    Thanked 2,548 Times in 2,526 Posts
    What has this to do with Javascript?

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Philip M View Post
    What has this to do with Javascript?
    I have <div><object>...youtube </object></div> for youtube.
    But IDM set its download button over the div.
    Now I want the div change to hidden if having IDM download button. Thanks for guide

  • #4
    Regular Coder
    Join Date
    Apr 2012
    Location
    St. Louis, MO
    Posts
    985
    Thanks
    7
    Thanked 101 Times in 101 Posts
    That's happening on YouTube, I'm pretty sure. I don't think there's a way to prevent that - it's their (Google's) site. If they are adding code on the fly, I'm not sure if that can be thwarted.
    ^_^

    If anyone knows of a website that can offer ColdFusion help that isn't controlled by neurotic, pedantic jerks* (stackoverflow.com), please PM me with a link.
    *
    The neurotic, pedantic jerks are not the owners; just the people who are in control of the "popularity contest".

  • #5
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    The thing will be clear if we can use javascript to detect IDM.
    I need the code to regconize IDM resident
    Last edited by docco; 02-27-2014 at 03:37 AM.

  • #6
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by docco View Post
    The thing will be clear if we can use javascript to detect IDM.
    I need the code to regconize IDM resident
    I doubt you can hide the button. The whole point of download manager programs adding those buttons is to get around author restrictions on downloading videos. If it could be done, YouTube would probably have done it already.

    That said, you might be able to detect that the IDM plugin is installed via the navigator.plugins object. However, I'd expect that the most you can do with this information is to prevent your video from being loaded and/or adding alternative content if it's installed. (I'm not willing to download and install IDM to test the theory, however.)
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #7
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    I doubt you can hide the button. The whole point of download manager programs adding those buttons is to get around author restrictions on downloading videos. If it could be done, YouTube would probably have done it already.

    That said, you might be able to detect that the IDM plugin is installed via the navigator.plugins object. However, I'd expect that the most you can do with this information is to prevent your video from being loaded and/or adding alternative content if it's installed. (I'm not willing to download and install IDM to test the theory, however.)
    Great, Arbitrator!!!!
    I have no problem with the IDM button. When I detect the presence of IDM, I will set the div containing the video to be hidden. Only if the user disable his IDM plug-in, the div of video will be showed.

    It seems to me that IDM escapes from navigator.plugins. Thanks if you suggest the code for detecting IDM.
    Last edited by docco; 02-27-2014 at 08:34 AM.

  • #8
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,401
    Thanks
    11
    Thanked 595 Times in 575 Posts
    Since this would be an extension and not a plugin, you won't find it in navigator.plugins...

    All hope is not lost; if you see something on-screen, it will be in the dom as well, and if it's in the dom, it can be found using JS. Use the inspector feature of your developer console to compare the HTML near your <object> tag with and without IDM enabled. You can probably select something on the button itself, and "inspect element" to jump right to that markup. Once you find it, look for an ID or classname that it uses; a "smoking gun" or class, tag, and id attribs that only the feature uses. You can then use document.querySelector() to detect if that extra markup is in the dom, and if it is, that means IDM is active and you should take additional step to hide the IDM interface or disable the video.
    Last edited by rnd me; 02-28-2014 at 04:22 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #9
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by rnd me View Post
    Since this would be an extension and not a plugin, you won't find it in navigator.plugins...

    All hope is not lost; if you see something on-screen, it will be in the dom as well, and if it's in the dom, it can be found using JS.
    Hmm... Good point. According to the IDM website, it's an extension alright.

    I looked into this with my preferred download manager (Free Download Manager) which adds a button above videos. One can right-click the button and press the keyboard shortcut for the Inspect Element command (Q) to see the a element it inserts into the document. The element has a self-identifying class attribute that one could use for detection purposes.

    That said, you won't be able to stop people from getting your videos though. I don't even use that plug-in to download videos; I keep it disabled. I just press Ctrl+Shift+Q in Firefox to find the video in the download list and download it directly. Well, except for YouTube. I use aTube Catcher for that. I don't think the Ctrl+Shift+Q method would work there since I get the impression they stitch together video files instead of presenting a single video file.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #10
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,401
    Thanks
    11
    Thanked 595 Times in 575 Posts
    a lot of times you can disable flash to force html5 video, and those urls show up in the F12 network tab where you can right-click them and open in a new tab or save them, or both. youtube has recently made it a harder to do this, and some videos can't seem to fetch even using html5, because of chunking...
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #11
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    In Windows enviroment, I think you cam know what program are in active. Return to IDM, how can I detect it by javascriptt? Can you help me more about using document.querySelector().

  • #12
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,338
    Thanks
    29
    Thanked 282 Times in 276 Posts
    Quote Originally Posted by docco View Post
    In Windows enviroment, I think you cam know what program are in active. Return to IDM, how can I detect it by javascriptt? Can you help me more about using document.querySelector().
    Do as I mentioned in post #9 (or similar actions if you don't use Firefox) to get this information. I doubt anyone is going to install IDM to do it for you.

    Quote Originally Posted by docco View Post
    Can you help me more about using document.querySelector().
    querySelector takes a CSS selector as an argument. For example, you would use document.querySelector("a.someClass") to select an anchor element with class="someClass".

    Quote Originally Posted by rnd me View Post
    a lot of times you can disable flash to force html5 video, and those urls show up in the F12 network tab where you can right-click them and open in a new tab or save them, or both. youtube has recently made it a harder to do this, and some videos can't seem to fetch even using html5, because of chunking...
    I've noticed that the program I use shows video and audio streams without the corresponding audio and video, respectively. Wouldn't surprise me if they split them in HTML5 to make things more difficult for downloaders.
    For every complex problem, there is an answer that is clear, simple, and wrong.

  • #13
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Arbitrator View Post
    querySelector takes a CSS selector as an argument. For example, you would use document.querySelector("a.someClass") to select an anchor element with class="someClass".
    It is not easy because the problem is how to know someClass

  • #14
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Open the dev tools (F12) and inspect the download button and check if there is any identifying id or class that you can use to reference that button and hide.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #15
    Regular Coder
    Join Date
    Aug 2012
    Posts
    127
    Thanks
    18
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by glenngv View Post
    Open the dev tools (F12) and inspect the download button and check if there is any identifying id or class that you can use to reference that button and hide.
    My page has only one <div> to contain youtube video in <body>. A small button (it maybe a child window in my page) of the downloader appear within the page but I can not see it with F12.

    Where should I check: Elements? Resources? Network? Sources? Timeline? Profiles? Audits? Console? in window of F12 developer tool?

    Another way is that I want to control everything in my page/window. I do want set any child windows/button hidden, except only one div I want to show. Can I do?
    Last edited by docco; 03-05-2014 at 07:34 AM.


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •