Closed Bug 1843754 Opened 2 years ago Closed 11 months ago

devtool not working for iframe after page refresh

Categories

(DevTools :: General, defect)

Firefox 115
defect

Tracking

(Not tracked)

RESOLVED INCOMPLETE

People

(Reporter: intellild, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0

Steps to reproduce:

1.open a page with an iframe in it
2.open devtool
3.refresh the page

Actual results:

devtool fails to working for the iframe element

Expected results:

devtool should work well with the iframe element
(reopen the devtool is a workaround)

Hello, thank you for the bug report!
Unfortunately I could not reproduce your issue. Would you be so kind as to answer a few questions so we can investigate this further?

Moving the Product to 'Devtools' and Component to 'General' . Please change if there's a better fit, thank you.

Component: Untriaged → General
Product: Firefox → DevTools

Hi xiexie,

Can you answer the questions Ardelean above?
Especially a test case or test website would be helpful. Normally devtools work fine with iframes, but you might be experiencing an edge case we haven't tested before.

Thanks.

Flags: needinfo?(intellild)

I am trying to make a minimal reproduce

I am using a open source libaray https://github.com/rrweb-io/rrweb

The project structure is
app -> shared libaray -> rrweb

The shared library is in a separate git repo, if I use the package from private npm repository, it works fine
But for development, I use pnpm link to my shared library in local disk, devtools stops working for created by rrweb
It could be related that rrweb uses document.close() then document.open() to reload iframe content.

This is the screen shot when the bug is hit
https://1drv.ms/i/s!AhZBJ6OGSnH2gvdwD4HVQg_-I6ELiw?e=1tJv3o

It exists on firefox 117.0b2 developer preview

(In reply to xiexie from comment #3)

It could be related that rrweb uses document.close() then document.open() to reload iframe content.

Thanks for the update, this might be related indeed. We have something similar filed for the whole document at Bug 1809092.
Although I tried to build a basic test case and I can't reproduce for now: https://iframe-document-write-bug1843754.glitch.me/

When you get the issue, can you open the browser toolbox or browser console and check if you see any devtools errors? Maybe similar to the ones mentioned in Bug 1809092?

I can see some errors

Unable to find target with innerWindowId:23622320134 10 watcher.js:188:13
    getWindowGlobalTargetByInnerWindowId resource://devtools/client/fronts/watcher.js:188
    _getTargetForWatcherResource resource://devtools/shared/commands/resource/resource-command.js:905
    _onResourceUpdated resource://devtools/shared/commands/resource/resource-command.js:780
    _emit resource://devtools/shared/event-emitter.js:242
    emit resource://devtools/shared/event-emitter.js:186
    emit resource://devtools/shared/event-emitter.js:330
    onPacket resource://devtools/shared/protocol/Front.js:349
    onPacket resource://devtools/client/devtools-client.js:471
    send resource://devtools/shared/transport/local-transport.js:67
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
TypeError: can't access property "getFront", container.node.targetFront is null
    _getVisibleChildren resource://devtools/client/inspector/markup/markup.js:2401
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2310
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2184
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1582
    _emit resource://devtools/shared/event-emitter.js:242
    emit resource://devtools/shared/event-emitter.js:186
    emit resource://devtools/shared/event-emitter.js:330
    getMutations resource://devtools/client/fronts/walker.js:309
    onMutations resource://devtools/client/fronts/walker.js:318
    onPacket resource://devtools/shared/protocol/Front.js:333
    onPacket resource://devtools/client/devtools-client.js:471
    send resource://devtools/shared/transport/local-transport.js:67
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
markup.js:478:15
    _handleRejectionIfNotDestroyed resource://devtools/client/inspector/markup/markup.js:478
    (Async: promise callback)
    _updateChildren resource://devtools/client/inspector/markup/markup.js:2349
    _forceUpdateChildren resource://devtools/client/inspector/markup/markup.js:2184
    _onWalkerMutations resource://devtools/client/inspector/markup/markup.js:1582
    _emit resource://devtools/shared/event-emitter.js:242
    emit resource://devtools/shared/event-emitter.js:186
    emit resource://devtools/shared/event-emitter.js:330
    getMutations resource://devtools/client/fronts/walker.js:309
    onMutations resource://devtools/client/fronts/walker.js:318
    onPacket resource://devtools/shared/protocol/Front.js:333
    onPacket resource://devtools/client/devtools-client.js:471
    send resource://devtools/shared/transport/local-transport.js:67
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
Error: Protocol error (TypeError): can't access property "rawNode", node is null from: server0.conn9.windowGlobal23622320157/pagestyle21 (resource://devtools/server/actors/page-style.js:253:5)
    onPacket resource://devtools/shared/protocol/Front.js:383
    DevTools RDP*request resource://devtools/shared/protocol/Front.js:300
    name resource://devtools/shared/protocol/Front/FrontClassWithSpec.js:47
    refreshPanel resource://devtools/client/inspector/computed/computed.js:574
    refresh resource://devtools/client/inspector/computed/computed.js:1633
    _emit resource://devtools/shared/event-emitter.js:242
    emit resource://devtools/shared/event-emitter.js:186
    emit resource://devtools/shared/event-emitter.js:330
    onMutations resource://devtools/client/inspector/shared/style-change-tracker.js:85
    _emit resource://devtools/shared/event-emitter.js:242
    emit resource://devtools/shared/event-emitter.js:186
    emit resource://devtools/shared/event-emitter.js:330
    getMutations resource://devtools/client/fronts/walker.js:309
    onMutations resource://devtools/client/fronts/walker.js:318
    onPacket resource://devtools/shared/protocol/Front.js:333
    onPacket resource://devtools/client/devtools-client.js:471
    send resource://devtools/shared/transport/local-transport.js:67
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103
    makeInfallible resource://devtools/shared/ThreadSafeDevToolsUtils.js:103

A needinfo is requested from the reporter, however, the reporter is inactive on Bugzilla. Given that the bug is still UNCONFIRMED, closing the bug as incomplete.

For more information, please visit BugBot documentation.

Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Flags: needinfo?(intellild)
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.