Chrome Extension Edit Specific Iframe - javascript

I am looking to only edit a specific iframe with my content script. In my iframe, I have a website (i'll use facebook as an example) that I would like to edit to remove a specific element. I am able to do that without any problem but let's say the user goes to facebook.com outside of the iframe, the website will be edited too. I am looking for a way to only edit the website within the iframe.

Related

Is it possible to hide a certain HTML element from a Chrome Extension?

I'm writing a webpage which I want to embed a video on that can't be seen by Chrome Extensions. I don't want to hide the element to the user, just hide it from the extension's view.
Is this even possible, and if so, how would I go about it?

IFrame should breakout, when a link in the IFrame was clicked

I'm working on a Webapp, which just put a layer over a website (http://mywebapp.com/http://www.example-website.com/).
The Website is embedded in an IFrame, so I don't know when the URL of the Website changed. I'd like the have this behaviour: "When a link was clicked in the IFrame, the IFrame should breakout of my window".
I also created for Chrome and Firefox an extension, that is just an icon, which puts "http://mywebapp.com/" for the current URL in the current selected tab.
Is it possible to achieve this behaviour with an extension?
Ok, I found something called content scripts.
Firefox
Chrome
I hope i can access with these extensions the IFrame, I'll give it a try.

How to know if iframe is blocked?

Some website don't allow you to view their website in an iframe. I would like to know what code I could use to identify this and redirect to another page in this situation.

Detect IFRAME blocking?

I'm working on a site that will display HTML content from other links within an IFRAME. I know that a lot of sites have JavaScript code that will detect the content is being displayed in an IFRAME and prevent it from rendering. I'd like to be able to detect the presence of this IFRAME blocking code, and redirect the user to the original page (without the IFRAME) if it would normally be block.
Try as I might, though, I haven't found anything reasonable that works. Have any of you implemented something like this? Any pointers?
UPDATE: For those of you who want to see what I'm talking about, here is a link that shows the behavior. If you look at it in Firebug, you'll see that the HTML content from the IFRAME is empty.

How to use onclick on a iframe tag

How to use onclick in iframe tag to call a javascript.
I basically want redirect to other page when a user clicks on a iframe.I have added the facebook like button my site which is a iframe code. So once he has clicked on the like button i want him to get redirected to a thank you page
EDIT:
i don't want to redirect the iframe but i want to redirect the main page on any interactivity with iframe. On solution is on focus or or on click on iframe i should be able to redirect. Can i at least do it.
You can't do that. Facebook's XFBML elements (like the 'Like' button) are on a different domain than your own (and only function that way); using Javascript to modify that frame isn't possible due to security restrictions.

Categories

Resources