Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For RSS/Atom, you put this in the XML, right inside the document element (the <feed> element or the <rss> element):

    <script src="https://example.org/script.js"
       xmlns="http://www.w3.org/1999/xhtml"></script>
You can also put CSS in there, like this:

    <style xmlns="http://www.w3.org/1999/xhtml">
      * { color: red; }
    </style>
Or like this:

    <link href="https://example.org/style.css"
       rel="stylesheet" xmlns="http://www.w3.org/1999/xhtml"/>


How's the support for the first option? If that reliably works, I'm gonna stop being angry, as it solved all my needs (and would allow polyfilling xslt anyway)

On second thought, that wouldn't allow me to modify the DOM before it's being parsed, I'd have to wipe the DOM and polyfill the entire page load, right?


It works great in Chrome, Safari, and Firefox.

https://github.com/dfabulich/style-xml-feeds-without-xslt

Google has recommended a polyfill for XSLT ever since they announced their plan to remove it. https://developer.chrome.com/docs/web-platform/deprecating-x...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: