Giter Club home page Giter Club logo

Comments (15)

deltakosh avatar deltakosh commented on May 19, 2024

I will definitely need more info to help.Can you commit your code in a temporary branch?

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh I just pushed it to the components branch

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

Here is the line that throws: https://github.com/MicrosoftDX/Vorlonjs/blob/components/Plugins/Vorlon/plugins/domExplorer/vorlon.domExplorer.ts#L220

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh I am adding a listener to handle refresh events thrown from within the DOM Explorer's DOM tree panel. It appears that something is taking issue with a Plugin's function being invoked from inside an event handler.

Is there some form of custom, object-checking/locking CSP that the project or TypeScript employs to prevent this?

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

Not to my knowledge:(

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

Warning there is a misunderstanding here: the refresh function does not exist dashboard side. You have to send a refresh message to the client side of the plugin.

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

Like this:
Core.Messenger.sendRealtimeMessage(this.getID(), { type: "refresh" }, RuntimeSide.Dashboard);

And then you have to update this function:
https://github.com/MicrosoftDX/Vorlonjs/blob/components/Plugins/Vorlon/plugins/domExplorer/vorlon.domExplorer.ts#L188

in order to add a "refresh" case

Does it make sense?

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh this event is not coming from the client, it is coming from the dashboard's own UI/elements. If you log this.refresh in the scope of that event handler it clearly exists.

Why would a Plugin be charged with creating its own dashboard UI and have no access to its own public/private functions? I don't understand that aspect, can you clarify?

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh you said this in the comment above: "Warning there is a misunderstanding here: the refresh function does not exist dashboard side", but then how come I can log the function and execute it? A security warning makes me thing the object is protected in some way. If the function didn't exist, wouldn't that handler immediately throw undefined when binding/calling it?

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

Actually it exists as the same code is executed on the client and on the dashboard. But the dashboard is not executed on the device, so there is no reason to execute refresh() function dashboard side. Right?

You need to use the messenger as I shown before to send a message to the client part of the plugin in order to execute refresh on the device

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

I mean: the click will happen on the dashboard, the dashboard is gonna use the messenger to send a message to the client, the client will receive the message, process it and resend the result back to the dashboard

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh hmm, ok, I thought refresh() was the function that performed that flow (sending a message to the client and grabbing latest). I will take another look.

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

Ok I understand so :)

from vorlonjs.

csuwildcat avatar csuwildcat commented on May 19, 2024

@deltakosh got it working, thanks for the clarification :)

from vorlonjs.

deltakosh avatar deltakosh commented on May 19, 2024

My pleasure my friend

from vorlonjs.

Related Issues (20)

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.