Giter Site home page Giter Site logo

Comments (5)

sktguha avatar sktguha commented on August 29, 2024 1

Oh nice extra info is added after four years 😂

from inspector-clouseau.

davidjgoss avatar davidjgoss commented on August 29, 2024

Hi @sktguha

Frames are supported, but looks like the problem you have there is that your frame's source is on a different origin (i.e. not localhost).

The little script that goes and gets the widget object and returns it to DevTools is dropped into the parent window and then checks its child frames (although not recursively) for Dijit instances. Since browsers guard against a parent window's scripts accessing the contents of a cross-origin frame, our little script is stopped in its tracks, and this is the error we see. Unfortunately I don't think there is a way around this; unlike normal Chrome extensions, DevTools extensions can only directly run code in the parent window.

However, I'm going to keep this open and labelled as a bug, as I do need to handle this sort of error more gracefully (it's far from unique to you, I'm sure) and get this limitation documented.

from inspector-clouseau.

sktguha avatar sktguha commented on August 29, 2024

ah I see. thanks for responding so fast :). btw I was wondering then if a message could be passed to the background page with the id of the current tab , which can do tab.injectScript with allFrames as true and hence return the dijit.byId data to the devtools js via the sendResponse. Actually I just read this https://developer.chrome.com/extensions/devtools#injecting

Also apologies if you already know about this, but if sendResponse is called async then true needs to be returned, else sendResponse becomes invalid, http://stackoverflow.com/questions/20077487/chrome-extension-message-passing-response-not-sent

from inspector-clouseau.

davidjgoss avatar davidjgoss commented on August 29, 2024

That looks worth investigating, thanks. I have a feeling, though, that the messages you pass back and forth between the window and the DevTools extension have to be JSON-compatible objects, which would rule out Dijit widgets, but we'll see.

from inspector-clouseau.

sktguha avatar sktguha commented on August 29, 2024

Ah I see. hmm I tried doing a djijt.byId. I could stringify it. I suppose as long as it an object then it should not be an issue. But I guess cyclical structures can still cause issue (specifically dom nodes)
However https://github.com/douglascrockford/JSON-js is also a good option for stringifying cyclic objects. I haven't used it actually yet

JSON.stringify(dijit.byId('dijit_DialogUnderlay_0'))
"{"_toConnect":{},"_attachPoints":["node"],"_attachEvents":[],"srcNodeRef":null,"_connects":[],"_supportingWidgets":[],"params":{"dialogId":"widgets_Dialog_1","class":"popupContainer_underlay"},"dialogId":"widgets_Dialog_3","class":"HistoryDetailsPopup_underlay","id":"dijit_DialogUnderlay_0","domNode":{},"_inherited":{"p":5},"node":{},"_created":true,"_focused":false,"focused":false,"_hasBeenBlurred":true,"bgIframe":{}}"

from inspector-clouseau.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.