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'm looking into replacing callback and XMLHttpRequest by
Fetch doesn't support
file://
hence I've decided not to use it, because callback and XMLHttpRequest do allowfile://
. See Newspaper/issues/Observation_Fetch_API.This is the code for Promise and it seems to skip the statement
(document.URL.startsWith('file:'))
that should allow applying this userscript to local files too.let myPromise = new Promise(function(myResolve, myReject) { let request = new XMLHttpRequest(); request.open('GET', document.documentURI); request.onload = function() { if (request.status == 200) { myResolve(request); } else { myReject("File not Found"); } }; request.send(); }); myPromise.then( function(request) { if (document.URL.startsWith('file:')) { mimeType = document.contentType; } else { mimeType = request .getResponseHeader('Content-Type'); } if (checkMediaType(mimeType)) { renderFeed(request.response) } }, function(error) {checkMediaType(error);} );
Please help.
Thank you.
Solved!
New code at
https://openuserjs.org/scripts/sjehuda/Newspaper
Old code at
https://openuserjs.org/scripts/sjehuda/Newspaper_(XMLHttpRequest)