Disable download button from iframe tag - javascript

Im using the iframe tag to display videos in my site, but it keeps showing a download button (see the picture bellow) that I need to disable.
<iframe src="http://techslides.com/demos/sample-videos/small.mp"></iframe>
Is it possible to disable and to control this?

It should not be able to if the pages are from different domains.
It might work when the two pages are from the same domain. In this case you can try:
window.frames[0].document.getElementById('buttonId') ...//you can use javascript or jquery to remove this elment

Related

hide a div on a website

I know to hide a div on a website if I have the source control. I can set div display to none or call javascript hide() on the div id. But how can I permanently remove a div from a website for which I don't have a source control. Just for my rendering, if I load or refresh the page, I should see that div gone. Are there any basic work around or hacks for that? I don't want to inspect and set display none for div every time I refresh the website.
Have a look at Tampermonkey for Chrome
or Greasemonkey for Firefox
You might use a (somewhat weird :) construct: build your own HTML document, containing only:
an <iframe src="---your external page--->"
a <script> where you explicitly add style="display: none;" to all elements where you need it
Browser (Chrome in my example) extensions has needed functionality.
You can use Custom JavaScript for websites extension, and configure additional code execution for every page reload without opening DevTools.

How to click iframe element in wordpress (all pages)?

I have a wordpress website, where I have pages with artists. This is an example: http://chasefetti.paradigmrecordsinc.com/ of a page from my website
On the top I have an iframe from arena.com
I want after the page loads to click the play button.
If I do it on the arenas page http://arena.com/artist/chasefetti like this (using firebug):
document.getElementsByClassName("fg icon-play-fg")[0].click()
it works, but on my website I guess it doesn't know about accessing the iframe.
How can I specify to access that iframe ?
Also the full mission that I gotta do is to play that button for each page. I am thinking to add a jquery that does what I want to do, to the templates page.
My main problem is accessing that element from the iframe
As far as I know(I tired it once) you can't do that, unless the source of the iframe is on the same site as yours, which isn't the case here.
Also check this same-origin policy.

Inject Code into an iFrame to Hide a Specific Element

I am attempting to hide an element loaded in an iFrame using CSS/jQuery/Javascript. The iFrame content is located on a different domain. I am trying to hide a button on the page loaded inside the iFrame. The buttons HTML is:
<a href="/Communication" id="lbtnMessage" class="bsrpBlueButtonLink">
<div class="NavButtonMess">
<span>Messages</span>
</div>
</a>
I have read mixed answers around the Internet on whether or not this is possible. I just need to be able to hide this block of code in the iFrame source. I this at all possible?
One possible solution is to use postMessage, obviously you need to control both domains.
This jquery plugin handles it pretty well : http://benalman.com/projects/jquery-postmessage-plugin/
If you don't control both domains then, due to security this is impossible. All you can do, is resizing / hiding the iframe.

jquery click element in iframe

I want to click the next button on the slides here - http://engineer.org.in/2011/realtime/ programmatically using JavaScript. The videos is in an iframe.
I tried $("div.punch-viewer-right").click() but that didnt work.
Can anybody tell me why this is not working?
because of XSS security issues, you can not access the iframe because it is not in the same domain as the website trying to access it.

Trigger click on embedded PDF

I have a PDF embedded in a web page using the following code:
<object id="pdfviewer" data='test_full.pdf#page=1&toolbar=0&statusbar=0&messages=0&navpanes=0'
type='application/pdf'
width='500px'
height='350px'>
The PDF itself is set to open in full screen mode which shows no controls. The user can advance the slides by clicking on the view.
What I'd like to have is some way to trigger that click so that I can advance 2 similar PDF:s side-by-side (one for the actual slideshow and one for the speaker notes). Is this possible to do in javascript and/or jQuery? I have tried using the click()-method but it doesn't get through to the embedded PDF.
Update: Can't find any info on it, so I guess I'm out of luck and have to try a workaround. Am currently juggling 3 embeds of the same pdf (current page, next page and previous page), hiding and showing them and loading more pages as the user clicks around.
I doubt it. Allowing web page scripts to pass input events to the PDF viewer could be a security risk (since the viewer generally has access to system file dialogues via things like Save As).

Categories