How to change style of iframe content cross-domain?

前端 未结 3 682
孤独总比滥情好
孤独总比滥情好 2020-11-27 07:42

I want to make background color black and text color white for the content inside iframe from its default of normal white background and black text. The iframe src attribute

相关标签:
3条回答
  • 2020-11-27 08:14

    This one's been here a while, but hopefully this will help someone....

    The closest I can see is using a filter on the iframe

    Xray: makes it black and white then inverts it.

     <iframe style="filter:xray" src=".....
    

    Invert: inverts all the colors rather than just swapping black & white.

     <iframe style="filter:invert" src=".....
    

    Both only work in IE. I thought these only worked on images till a few minutes ago...

    eg. http://www.ssi-developer.net/css/visual-filters.shtml

    0 讨论(0)
  • 2020-11-27 08:29

    The only possibility would be to load the iframe content through a proxy of yours and modify the HTML content. You can not access iframes from another domain via JavaScript.

    0 讨论(0)
  • 2020-11-27 08:35

    It isn't possible. The whole point of the Same Origin Policy is that you can't access or manipulate content from another domain.

    0 讨论(0)
提交回复
热议问题