Are you sure you want to go to an external site to donate a monetary value?
WARNING: Some countries laws may supersede the payment processors policy such as the GDPR and PayPal. While it is highly appreciated to donate, please check with your countries privacy and identity laws regarding privacy of information first. Use at your utmost discretion.
Hello,
I've rewrote Newspaper to work without XSLTProcessor, which turned out to be even easier and shorter, and now it works with all web browsers.
Background
Once a page is validated to be of type feed, the executes two main actions to generate an HTML page.
Function
renderXML(xmlFile, atomRules)
to gather data bfrom the file and generate an HTML out of it.Function
extensionLoader()
which adds CSS stylesheet and some functions of accessibility and navigation.This script has been tested successfully with all formats: Atom, ActivityStream, JSON, RDF and RSS.
Issue
However, the part of
extensionLoader()
doesn't always work, and the reason is unknown to me.Below are two feeds on the same server of same content but different formats (one is XML and the other is JSON); the function
extensionLoader()
works only with the JSON feed.https://www.jsonfeed.org/feed.xml
https://www.jsonfeed.org/feed.json
This post is not related to this thread
Please help!
Kindly,
Schimon
This is the function in question.
function extensionLoader(url) { purgeStylesheets(); formatDate(); setCssStylesheet(); decorateEntry(); linksBar(); follow(url); subToMe(url); aboutPage(); donatePage(); settleFilters(); scrollDown(); statusBar(); mailTo(); }
The functions
formatDate()
,linksBar()
,aboutPage
,donatePage
andstatusBar()
do work for the XML feed, but not all the rest of the functions, such assetCssStylesheet();
.Styling functions tend to work in more cases when loading them to the generated document before setting it with the original document, but I'm interested in doing all the post-work after the HTML file is ready.
Here are two feeds (XML and JSON) of same server and content that do work with the userscript.
https://furbo.org/feed/
https://furbo.org/feed/json/
This is all the relevant information.
Thank you for any of your kind help.
https://furbo.org/feed/atom/
Setting arbitrary MIME Type (
document.contentType
) using Open in Browser will result in the following findings:Opening as "text/plain", "text/html" will make everything work.
Opening as "text/xml" (including "application/xml" etc.) will only build HTML file, without CSS related additions.
Attempting to set MIME Type using this code has failed:
request.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
Testing feeds:
https://www.kaidan.im/atom.xml
https://www.falkon.org/atom.xml
https://www.jsonfeed.org/feed.xml
https://furbo.org/feed/atom/
Setting arbitrary MIME Type (
document.contentType
) using Open in Browser will result in the following findings:Opening as "text/plain", "text/html" will make everything work.
Opening as "text/xml" (including "application/xml" etc.) will only build HTML file, without CSS related additions.
Attempting to set MIME Type using this code has failed:
request.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
Testing feeds:
https://www.kaidan.im/atom.xml
https://www.falkon.org/atom.xml
https://www.jsonfeed.org/feed.xml
This thread is solved, as the problem has been detected.
This thread (new issue) continues at Forging content type / mime type.