Closed Bug 1530342 Opened 6 years ago Closed 6 years ago

Can't add add link to head in iframe because of cross-origin error, but apparently works in Chrome

Categories

(Core :: DOM: Core & HTML, defect)

65 Branch
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: hosein.danesh20, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0

Steps to reproduce:

hi , sry im so confiused because of this problem !
iframe , iframe , iframe !! my bad dream every night :))
problem :
how i can add some link tag(contains css file) to head of iframe tag !
i search so much . all says u cant access to iframe head because of cross origin policy !! but i can access in chrome ! (in chrome we can access to iframe everything , wait wait , this is true for iframes that have not src (behavoir like a div tag !) , if that iframe have src attr contains some domain link , here cross origin policy worked and you cant access to iframe contens right now !)

I hope that I will explain well this problem !
please fix it ...
some developers need this so much .
i hope mozilla help us .

Actual results:

when i add some link tag to head of iframe it dosnt work !
(in chrome its work on iframes that has not src attribute , and when it has src attr you cant access to iframe contents)

Expected results:

i hope to fixed this problem
and What should have happened?
when we add link tag to head of iframe :

  1. it must not worked in iframes that have src attr(contains some address)
  2. it must work in iframes that have not src attr (behavoir like a div tag !)

Hi @Hosein danesh, If you can provide a scenario, test-case or something related to test your problem it will be great, if not I guess the dev's team can handle further the problem.
Thanks for your contribution.

Component: Untriaged → CSS Parsing and Computation
Product: Firefox → Core

Can you add a test-case that repros the issue, or an example of which domains are involved and how the iframe is created or what not? Otherwise this is not really actionable.

Also, ensure you're waiting for the iframe to load properly? Otherwise you may accidentally add the link to about:blank.

Component: CSS Parsing and Computation → DOM
Flags: needinfo?(hosein.danesh20)
Summary: add link to head in iframe !! → Can't add add link to head in iframe because of cross-origin error, but apparently works in Chrome
Component: DOM → DOM: Core & HTML

It's hard for us to move on without a simple test case.
Dear reporter, please feel free to reopen when you have a chance to get back here with the kind test case mentioned in comment 2. :)

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.