coderaiser/cloudcmd

feat: Supports injecting scripts into the client

wll8 opened this issue · 9 comments

wll8 commented

Supports injecting scripts into the client, which is convenient for adjusting page content, customizing functions...

E.g:

Now there is no way to clearly identify the text, if the official does not provide skin or configuration, but provides the function of injecting code.

image

This will let me solve this problem very quickly.

I tried to query the documentation and code of jq-console and console-io, but there is no customizable solution in cloudcmd.

wll8 commented

If I want to modify the styles on the page, do I think of the [User Menu]?

You can load any styles you want with help of User Menu, and then load Console.

wll8 commented

Is there a way to have the script execute on the page without triggering the user menu?

There was such way as plugins but support was dropped inf favor of User Menu.

I suggest you to start from User Menu, and then if you will have ideas how to make it in another way we can try :).

wll8 commented

thanks. I would try the plugin way first

thanks. I would try the plugin way first

Plugins not supported since Cloud Commander v11.

wll8 commented

T_T......

app.use(prefix, cloudcmd({
    socket, // used by Config, Edit (optional) and Console (required)
    config, // config data (optional)
    modules, // optional
    configManager, // optional
}));

This place might implement a service via express and deliver index.html to the browser.

You can try inside app.use ,

Through middleware,

Rewrite index.html and inject the script.

Yes, but why not just use User Menu :)? As I said, this already was implemented...