Applying CSS to a website fails
See original GitHub issueI am trying to apply a CSS to a website like so:
await Page.enable();
await DOM.enable();
await CSS.enable();
const frame = await Page.navigate({ url: 'https://google.com' });
const styleSheet = await CSS.createStyleSheet(frame)
const ruleText = 'body { background-color: red; }';
const location = {
startLine: 0,
endLine: 0, // should be split by \n if its multiline
startColumn: 0,
endColumn: 31, // guessing this has to be the length if it is a one liner? what about multi line? longest line?
};
await CSS.addRule(styleSheet, ruleText, location);
It fails with Error: Invalid parameters
and 'ruleText: string value expected; location: object expected'
Any idea what is happening? I can’t find anything in the documentation
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
How to Troubleshoot CSS Not Working - WPForms
Have you added custom CSS for your forms, but not been able to see it come through? Here's how to troubleshoot when your...
Read more >Handling common HTML and CSS problems - MDN Web Docs
CSS is arguably better at fallbacks than HTML. If a browser encounters a declaration or rule it doesn't understand, it just skips it...
Read more >Understanding why your CSS fails - LogRocket Blog
It can be tricky to find out why your CSS isn't working as expected. Learn ways of finding and preventing weird behavior in...
Read more >Complete list of reasons why a css file might not be working
3. The URL you're using inside your HTML link tag may be unaccessable, so manually try to visit the stylesheet with a browser...
Read more >How to Fix CSS file is not Working with HTML in Chrome
Fix CSS file is not Working with HTML in Chrome | Problem Solved ... In HTML CSS Website | Website Images Not Showing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works for me:
Ah perfect.
Thank you very much for your support!!!