I have been taught that one can not apply CSS to cross origin iframes, but I have found that Stylebot applies CSS to iframes successfully with no problem at all.
- How is this possible?
- Is there any chance I can do the same in my website?
I have been taught that one can not apply CSS to cross origin iframes, but I have found that Stylebot applies CSS to iframes successfully with no problem at all.
You can't apply custom CSS
to cross-origin iframe
( you can only if you have direct access to the both servers )
But..
Extensions can avoid those rules because files in extensions have different policy rules. So basically you can add a JavaScript
file to each and every page or iframe
. And from there you can basically do anything. And this JavaScript
file that was injected by your extension will never be blocked. Each and every browser has its own API, about Chrome
's way of doing things you can read here :
https://developer.chrome.com/extensions/content_scripts
About extensions you can read here: https://developer.chrome.com/extensions/getstarted