Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Supports injecting scripts into the client #379

Open
wll8 opened this issue Jun 17, 2022 · 9 comments
Open

feat: Supports injecting scripts into the client #379

wll8 opened this issue Jun 17, 2022 · 9 comments

Comments

@wll8
Copy link

wll8 commented Jun 17, 2022

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.

@coderaiser
Copy link
Owner

Try User Menu

@wll8
Copy link
Author

wll8 commented Jun 17, 2022

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

@coderaiser
Copy link
Owner

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

@wll8
Copy link
Author

wll8 commented Jun 17, 2022

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

@coderaiser
Copy link
Owner

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
Copy link
Author

wll8 commented Jun 17, 2022

thanks. I would try the plugin way first

@coderaiser
Copy link
Owner

thanks. I would try the plugin way first

Plugins not supported since Cloud Commander v11.

@wll8
Copy link
Author

wll8 commented Jun 17, 2022

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.

@coderaiser
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants