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

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.

Related

How to open link (provided in youtube video) in external browser instead of app using javascript, or php

How to open link (provided in youtube video) in external browser instead of app.
when i click on the link in description then a page opens in youtube app and shows the webpage but i want to display in external browsers, so what code i can do in my website to make this change.
Use a target attribute in your anchor.
target="_blank" should do the trick.
<a target="_blank" href="daily-cat-video">click to see the cats</a>
If you want to get fancier and include window sizes and things, look at
Opening new window in HTML for target="_blank"
an window.open.
. this will let you have more control over the window that gets open.
If you are in your mobile app, then opening in the youtube app is normal for android. It looks at the intent and will present the user with the options that can handle that intent.
If it gets a youtube video, it will ask the user if they want to open it in youtube 'just once, or always' as well as give the user other apps that can handle the intent too, i.e chrome,

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?

Chrome Extension Edit Specific Iframe

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.

Pull parent page url to chrome extension in iframe

I have some JavaScript code that returns the current visited page's url. This code runs as a href link. I would like to make it do the same when I open it using a Chrome extension that opens a page in an iframe (can be different domain). The iframe opens fine but the url does not populate. I have tried window.parent.location types to no avail.
javascript:void(window.open('http://www.example.com/..?s=%20'
+encodeURIComponent(document.title)+'%20'
+encodeURIComponent(location.href)+'%20'
+encodeURIComponent(window.getSelection())))

How to access bookmarks page and other chrome urls in an extension?

I'm developing an extension which replaces the new tab page with a set of other features.
I have a link on the new "new tab" page. And I've set the value of its href attribute to chrome://bookmarks
But whenever I click on it, I get an error message in the console saying "Not allowed to load local resource."
I also tried loading the unpacked extension files and tried it out. But still wasn't able to access the bookmarks page. I've seen many extensions which have links that can access the bookmarks page. For example, Dayboard.
How do I go about this problem?
You should be able to open chrome://bookmarks/ programmatically.
Make an click handler that triggers chrome.tabs.create({url: "chrome://bookmarks/"}) - I just checked and it works from a background page.
If you need to replace your current tab, use chrome.tabs.update.

Categories

Resources