sjehuda Author

So I did, placing the exact address inside @include or @match. Same result.

I also executed the script from console.
It works with Falkon, but not with Fx.


Re: @Martii:

One other quick note...

How exactly please?
This script has to be inclusive.

Perhaps // @match *://*?


Are you sure that 181 is that line...

Certainly.
Clicking on Newspaper.user.js:181 highlights code xsltProcessor.importStylesheet(xsltStylesheet);
I've also changed null to undefined and also deleted all lines. Both didn't work and yield the same result.

Your XML appears to be validated properly

I always check that it works in the traditional way, adding a reference to the stylesheet inside a given XML.

The RSS feed appears at a very quick glance to be correct too...

We can always test against https://kodi.tv/rss.xml or any other feed that doesn't cause to download prompt to open.

DOMParser.parseFromString has been notoriously different between browsers (a.k.a finicky) over the years on how it handles Strings and might be throwing an error since you don't appear to be checking for that.

I'll take a look.


I've briefly skimmed over the script syntax and I don't see anything right away that would prevent it from working. Do you get any errors/warnings in Browser Console specific to the script?

Only when using Tampermonkey for Firefox. Greasemonkey for Firefox shows no errors.

Uncaught 
Exception { name: "", message: "", result: 2153775105, filename: "moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0", lineNumber: 181, columnNumber: 0, data: null, stack: "renderFeed@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:181:17\ncheckMediaType@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:138:15\nhttpGetAsync/xmlHTTPRequest.onreadystatechange@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:85:15\nEventHandlerNonNull*httpGetAsync@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:69:3\ntms_acd40735_0cb5_4484_bcb0_b1d674174df0$@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:249:13\nit@https://www.blacklistednews.com/rss.php:14:1075\nwindow[\"__p__13666865.141279189\"]/</<@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:131\nwindow[\"__p__13666865.141279189\"]/<@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:531\nwindow[\"__p__13666865.141279189\"]@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:251:6\nit@https://www.blacklistednews.com/rss.php:14:1075\nset@https://www.blacklistednews.com/rss.php:3:400\n@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:1\nit@https://www.blacklistednews.com/rss.php:14:1075\nI[t]@https://www.blacklistednews.com/rss.php:4:485\nit@https://www.blacklistednews.com/rss.php:14:1075\ny@https://www.blacklistednews.com/rss.php:6:40\nsend@https://www.blacklistednews.com/rss.php:7:128\nV@https://www.blacklistednews.com/rss.php:3:307\nE_u/<@https://www.blacklistednews.com/rss.php:4:275\nE_u@https://www.blacklistednews.com/rss.php:4:330\ncreate/<@eval:64:45\ncreate@eval:65:178\nl@eval:6:96\nn@eval:5:325\nrun@eval:6:188\nTM_back/</</<@eval:67:49\nit@https://www.blacklistednews.com/rss.php:14:1075\nt@https://www.blacklistednews.com/rss.php:15:366\nTM_back/</<@eval:67:30\nTM_back/<@eval:67:59\nTM_back@eval:68:3\nwindow[\"__c__10191374.835477514\"]@eval:68:10\nit@https://www.blacklistednews.com/rss.php:14:1075\nset@https://www.blacklistednews.com/rss.php:3:400\n@eval:1:1\n" }
​
columnNumber: 0data: nullfilename: "moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0"lineNumber: 181message: ""name: ""result: 2153775105stack: "renderFeed@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:181:17\ncheckMediaType@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:138:15\nhttpGetAsync/xmlHTTPRequest.onreadystatechange@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:85:15\nEventHandlerNonNull*httpGetAsync@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:69:3\ntms_acd40735_0cb5_4484_bcb0_b1d674174df0$@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:249:13\nit@https://www.blacklistednews.com/rss.php:14:1075\nwindow[\"__p__13666865.141279189\"]/</<@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:131\nwindow[\"__p__13666865.141279189\"]/<@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:531\nwindow[\"__p__13666865.141279189\"]@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:251:6\nit@https://www.blacklistednews.com/rss.php:14:1075\nset@https://www.blacklistednews.com/rss.php:3:400\n@moz-extension://21fd3529-b958-4444-a848-78dc744a32b7/userscripts/Newspaper.user.js?id=acd40735-0cb5-4484-bcb0-b1d674174df0:1:1\nit@https://www.blacklistednews.com/rss.php:14:1075\nI[t]@https://www.blacklistednews.com/rss.php:4:485\nit@https://www.blacklistednews.com/rss.php:14:1075\ny@https://www.blacklistednews.com/rss.php:6:40\nsend@https://www.blacklistednews.com/rss.php:7:128\nV@https://www.blacklistednews.com/rss.php:3:307\nE_u/<@https://www.blacklistednews.com/rss.php:4:275\nE_u@https://www.blacklistednews.com/rss.php:4:330\ncreate/<@eval:64:45\ncreate@eval:65:178\nl@eval:6:96\nn@eval:5:325\nrun@eval:6:188\nTM_back/</</<@eval:67:49\nit@https://www.blacklistednews.com/rss.php:14:1075\nt@https://www.blacklistednews.com/rss.php:15:366\nTM_back/</<@eval:67:30\nTM_back/<@eval:67:59\nTM_back@eval:68:3\nwindow[\"__c__10191374.835477514\"]@eval:68:10\nit@https://www.blacklistednews.com/rss.php:14:1075\nset@https://www.blacklistednews.com/rss.php:3:400\n@eval:1:1\n"
​
<prototype>: ExceptionPrototype { toString: toString(), name: Getter, message: Getter, … }
​​
columnNumber: 
​​
data: 
​​
filename: 
​​
lineNumber: 
​​
message: 
​​
name: 
​​
result: 
​​
stack: 
​​
toString: function toString()
​​
Symbol(Symbol.toStringTag): "Exception"
​​
<get columnNumber()>: function columnNumber()
​​
<get data()>: function data()
​​
<get filename()>: function filename()
​​
<get lineNumber()>: function lineNumber()
​​
<get message()>: function message()
​​
<get name()>: function name()
​​
<get result()>: function result()
​​
<get stack()>: function stack()
​​
<set stack()>: function stack()
​​
<prototype>: Object { … }
Newspaper.user.js:181

It points to xsltProcessor.importStylesheet(xsltStylesheet);

Btw what version of Falkon are you using please.

falkon 22.04.0-1 (x86_64) - Arch Linux


Hello,

I'm using Falkon Browser which has it's own Greasemonkey extension.
I'm happily using Newspaper Native Feed Reader on Falkon.

Apparently, this script doesn't work with Firefox (tested against Greasemonkey and Tampermonkey).

However, since Firefox has dropped RSS (why, I don't know) we can still open files with PHP and XML extensions (in contrast .atom and .rss open download prompt since 2018), so trying against these feeds doesn't yield results.
https://kodi.tv/rss.xml
https://www.blacklistednews.com/rss.php

Please help!

It might has to do with these:
https://techdows.com/2018/10/mozilla-removes-rss-live-bookmarks-support-from-firefox-64.html
https://www.zdnet.com/article/end-nears-for-rss-firefox-64-to-drop-built-in-support-for-rss-atom-feeds-says-mozilla/
https://www.bleepingcomputer.com/news/software/mozilla-to-remove-support-for-built-in-feed-reader-from-firefox/
http://camendesign.com/blog/rss_is_dying (RSS lives on!)



Fixed. We reverse back the following changes

--- /scripts/sjehuda/Newspaper/source@1.0.2+e8feeb3
+++ /scripts/sjehuda/Newspaper/source
@@ -10,8 +10,8 @@
 // @include     * 
-// @version     1.0.2 
-// @run-at      document-start
+// @version     1.0.3 
+// @run-at      document-end
 // ==/UserScript==
 
 // NOTE
@@ -65,7 +65,7 @@
 function httpGetAsync(uri, callback) {
   var xmlHTTPRequest = new XMLHttpRequest();
   xmlHTTPRequest.onreadystatechange = function() { 
-    if (xmlHTTPRequest.readyState === 3) {
+    if (xmlHTTPRequest.readyState === 4) {
       xmlFile = xmlHTTPRequest.responseText;
       if (document.URL.startsWith('file:')) {
         mimeType = document.contentType;




Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-/000000000000000000/00000000000000000000000='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

Attempt made to circumvent this policy by placing CSS Stylesheet inside HTML header . This was also blocked.

However, setting style inside element itself DOES work!
<div class="entry" style="background:yellow">

Disadvantage: This is too specific and makes the Userscript file larger.

TODO: Check SaxonJS. If SaxonJS won't do the task, go back to this issue.



We want to have three columns instead of one.

We curently have a single column because text an images get misplaced with some feeds.

Three columns code:

#articles {
 display: flex;
 justify-content:space-between;
 flex-wrap: wrap;
 /* flex-direction: row; */
 max-width: 90%;
 margin: 0 auto;
 padding: 10px 0;
}

#articles > * {
 max-height: 29%;
 max-width: 29%;
 min-height: 29%;
 min-width: 29%;
 display: -webkit-box;
 -webkit-line-clamp: 11; /* number of lines to show */
         line-clamp: 11;
 -webkit-box-orient: vertical;
 margin: 0.5em;
 white-space: normal;
 vertical-align: top;
 margin-bottom: 50px;
 /* center entiries
 margin: auto;
 width: 50%;
 text-align: center; */
}

.entry {
 max-height: 230px;
 max-width: 29%;
 min-height: 230px;
 min-width: 29%;
 margin-left: auto;
 margin-right: auto;
 overflow: auto;
 line-height: 1.6;
 font-size: 85%;
  overflow-y: hidden; /* Hide vertical scrollbar */
  overflow-x: hidden; /* Hide horizontal scrollbar */
 /*
 animation effect to be used with transform upon hover
 transition: all .2s ease-in-out;
 -webkit-animation-name: none;
 */
}

/* TODO expand entry from center of screen upon hover */
.entry:hover {
 background: azure;
 /* transform: scale(1.8);
 height: 50em;
 width: 50vw; */
  
}

.entry * {
 max-width: 98%;
}

First check HEADER, then GET content @7nik.

Call twice to XMLHTTPRequest.

Once with HEAD and XMLHttpRequest.readyState === 2 (HEADERS_RECEIVED) and if page is a Feed; then

Once again with GET and XMLHttpRequest.readyState === 3 (LOADING) or 4 (DONE) when MIME-Type doesn't say ATOM or RSS but we find out that it is.



Is it possible to add or remove groups?
I'm not able to do either of which.


Replace raster graphics (bitmap-based) buttons by scalable (CSS-based) buttons.


You might want to add several more elements.

$('div.outerCookieBar').remove();
$("div[data-test-signup='true']").remove();
$("div[data-test-giftwrap='true']").remove();