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

Inject CSS feature request #2

Open
gitgit3 opened this issue Jun 25, 2024 · 0 comments
Open

Inject CSS feature request #2

gitgit3 opened this issue Jun 25, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@gitgit3
Copy link

gitgit3 commented Jun 25, 2024

It would be nice to be able to add some CSS to the page easily.

I was using the Rust bindings briefly and there was a inject_css() function supplied. I have written a similar function for dlang which calls webview_eval() to run some JS which adds a <script> tag to the head of the document. I've stuck it in copy of package.d for now.

One problem I am having is that the document is not fully loaded when I call inject_css() and the JS ca fail. It is not clear to me how to block, or is there a way of getting a callback when the document has finished loading.

I can of course setup an onload() in the body tag but I'd rather set the callback in the webview API if possible rather that messing around with yet more JS. I feel that this functionality should be available out-of-the-box.

Thoughts/help appreciated.

@thechampagne thechampagne added enhancement New feature or request help wanted Extra attention is needed labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants