3 ms·
Using a style element should have worked too. The HN CSP policy has unsafe-inline which covers both of these things. Perhaps your problem wasn't with CSP at al
by mike-cardwell 8y ago
Using a style element should have worked too. The HN CSP policy has unsafe-inline which covers both of these things.
Perhaps your problem wasn't with CSP at all, but something else. Maybe a CSS specificity issue?
[edit] - Yeah, I just created this bookmarklet and it worked fine:
javascript:(function(){s=document.createElement('style');s.textContent='*{font-size:20px}';document.head.appendChild(s)})()
- wunderwaffe 8y agoEven better! My solution was a link element with a data: URI. Yours is much more elegant. And works! Thank you very much!
- mike-cardwell 8y agoThat would be the problem. The HN policy for styles is: style-src 'self' 'unsafe-inline' This means they can include CSS from the same origin, or inline. It would need "data:" adding to the list to allow data URI's as an accepted source.