I was wondering if it was possible to have a script open a new tab to a page (that isn't owned by me), and have the head of the page be different from the original. If so, could you also add a new thumbnail for the tab? I found a few answers from around the web, but none of them worked. Help would be much appreciated. Thanks in advance!
1 Answers
Well, you can't really modify something that doesn't belong to you. So no, there's no way to send the user to another page than yours, and apply some modifications there.
BUT, there could be a way with iframes. iframes are a (old ?) way of embedding other HTML documents in one single page. Therefor, while the end user is still on your page, you can load the page that doesn't belong to you in the iframe so the end user sees it. Since he is still on your page, you have full access on the title and other elements. Was this the kind of answer you were looking for ?
Edit
Please disregard my answer.
Like user @rocket-hazmat mentioned, there is an origin policy issue to be handled with iframes. If you know the person behind the page you wish to point to (or load), then you might be able to workout something with him. Or else, iframes won't work (XSS protection).
- 607
- 5
- 14
-
I completely forgot about iframes (although I do recall a w3schools lesson about them). That could be exactly what I need. Thanks! – Dudeguy21 Oct 07 '15 at 19:41
-
My pleasure ;-) There's probably a reason why you forgot about them, iframes are a bit sketchy hahaha – John Pink Oct 07 '15 at 19:44
-
1This will not work. If the page is a [different domain](https://en.wikipedia.org/wiki/Same-origin_policy) from yours, then you ***do not*** have full access to the page. – gen_Eric Oct 07 '15 at 19:47
-
That's unfortunate. Is there any way to use javascript in the omnibox/searchbar to change the title of a page? I know that if you do it after the html loads, it will rewrite the entire thing, but would you be able to do it on loading? If so, how would one implement this in a link? – Dudeguy21 Oct 07 '15 at 21:45