Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing by print gives a blank page with only the text "undefined" on it #2130

Closed
sbrl opened this issue Nov 16, 2018 · 21 comments
Closed

Sharing by print gives a blank page with only the text "undefined" on it #2130

sbrl opened this issue Nov 16, 2018 · 21 comments
Milestone

Comments

@sbrl
Copy link

sbrl commented Nov 16, 2018

Hey! I've recently set up FreshRSS as an alternative to Miniflux 1 (v2 uses PostgreSQL exclusively, and I don't want a PostgreSQL database server!), and been generally happy with with actually.

I've encountered a bug though in the sharing system. I 'print' things often to a virtual PDF printer I've got setup. If I go to share -> print in FreshRSS, I get the text "undefined" on a white page. I'm including an image and a copy of the resulting PDF at the bottom of this report.

selection_092

Here's the PDF when I print:
mozilla.pdf

@Alkarex
Copy link
Member

Alkarex commented Nov 17, 2018

Hello @sbrl and welcome :-)
I cannot reproduce the problem.
Tested with Firefox on Ubuntu 18.04, Firefox + Chrome + Edge on Windows.
Do you have any information in your browser console?
Could you please try with another browser?

@sbrl
Copy link
Author

sbrl commented Nov 17, 2018

Ah, yeah I do get something in the console:

Content Security Policy: Directive ‘child-src’ has been deprecated. Please use directive ‘worker-src’ to control workers, or directive ‘frame-src’ to control frames respectively.
FreshRSS waiting for Sticky-kit… main.js:521:4
FreshRSS init done. main.js:1550:3
Content Security Policy: The page's settings blocked the loading of a resource at inline ("default-src"). i:1:1
This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://developer.mozilla.org/docs/Mozilla/Performance/ScrollLinkedEffects for further details and to join the discussion on related tools and features! i
Content Security Policy: The page's settings blocked the loading of a resource at inline ("default-src").
i:1:1
Content Security Policy: The page's settings blocked the loading of a resource at inline ("default-src").

@sbrl
Copy link
Author

sbrl commented Nov 17, 2018

Tried Chrome, and can still reproduce - though nothing of interest in the console. I'm using the dark theme, if that helps.

@Alkarex
Copy link
Member

Alkarex commented Nov 17, 2018

Would you mind making a test account for me in your FreshRSS instance? So I can see if it is something due to your instance, or due to your client. If not, I will make you a test instance.

@Alkarex
Copy link
Member

Alkarex commented Nov 17, 2018

I am guessing from your screenshot that you are using Ubuntu, aren't you? Which version?

@Alkarex
Copy link
Member

Alkarex commented Nov 17, 2018

Screenshot using Firefox in Ubuntu 18.04:

image

@sbrl
Copy link
Author

sbrl commented Nov 18, 2018

Yep, it's Ubuntu - v18.04 with the latest version of Firefox.

I've created an account for you at my server. Is there a private way I can give you the login details, @Alkarex?

@Alkarex
Copy link
Member

Alkarex commented Nov 18, 2018

@sbrl Please find my e-mail address here.

@Alkarex Alkarex added this to the 1.13.0 milestone Nov 18, 2018
@sbrl
Copy link
Author

sbrl commented Nov 18, 2018

Send & encrypted with GPG.

@Alkarex
Copy link
Member

Alkarex commented Nov 19, 2018

@sbrl Well received. Tested from your instance with Firefox 63 (64 bits) on Ubuntu 18.04, as well as Firefox 63 (64 bits) on Windows 10, both without problem. So it seems to be client-related. Could you please try with the exact same account than the one you just sent me?

image

@sbrl
Copy link
Author

sbrl commented Nov 20, 2018

Ah, thanks for checking it out! I've checked that out, and the debug account does indeed work as intended. However, if I switch back to my original account, it doesn't work again :-(

Does it make a difference if I imported my feeds via OPML? If need be, I can provide database dumps etc. for debugging purposes.

@Alkarex
Copy link
Member

Alkarex commented Nov 20, 2018

@sbrl I cannot really think of what could be different between the two accounts. Did you observe the problem on some specific feeds, or all feeds?
What database do you use? (not that it makes a difference for this bug, just to know what could be done to export the data)

@Alkarex
Copy link
Member

Alkarex commented Nov 20, 2018

Hum, maybe some settings could be different between your two accounts, one of which could interfere... E.g. shortcuts, extensions, mark-as-read options...

@sbrl
Copy link
Author

sbrl commented Nov 20, 2018

I've observed it on 2-3 different feeds now, so I think it's safe to say it's practically all feeds, though the they are all imported from Miniflux.

I use an SQLite3 database. Shall I send you a copy of the database for inspection?

@Alkarex
Copy link
Member

Alkarex commented Nov 20, 2018

Yes @sbrl , if not too confidential, please send me your SQLite database, so I can maybe reproduce the problem. Same channel as above.

@sbrl
Copy link
Author

sbrl commented Nov 20, 2018

@Alkarex Sent. The Firefox Send link expires after 1 download or 24 hours, so if you need me to send it again, just ask :-)

@Alkarex
Copy link
Member

Alkarex commented Nov 21, 2018

@sbrl Received :-) Will test tonight

@Alkarex
Copy link
Member

Alkarex commented Nov 24, 2018

@sbrl Thanks, I can reproduce the problem with the "Show articles unfolded by default" option. Will fix!

FreshRSS/p/scripts/main.js

Lines 1303 to 1322 in 01c4cd8

function init_print_action() {
$('.item.share > a[href="#"]').click(function () {
var content = "<html><head><style>" +
"body { font-family: Serif; text-align: justify; }" +
"a { color: #000; text-decoration: none; }" +
"a:after { content: ' [' attr(href) ']'}" +
"</style></head><body>" +
$(".flux.current .content").html() +
"</body></html>";
var tmp_window = window.open();
tmp_window.document.writeln(content);
tmp_window.document.close();
tmp_window.focus();
tmp_window.print();
tmp_window.close();
return false;
});
}

@sbrl
Copy link
Author

sbrl commented Nov 24, 2018

Ah, awesome! Glad I've been able to help in tracking down a bug. I await a fix :D

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Nov 24, 2018
Fix FreshRSS#2130
`.current` might not exist in views for which all articles are already
expanded
@Alkarex
Copy link
Member

Alkarex commented Nov 24, 2018

Fixed in #2148
Tests welcome!

Alkarex added a commit that referenced this issue Nov 26, 2018
Fix #2130
`.current` might not exist in views for which all articles are already
expanded
Alkarex added a commit that referenced this issue Dec 1, 2018
@Alkarex Alkarex closed this as completed Dec 16, 2018
@sbrl
Copy link
Author

sbrl commented Dec 16, 2018

Thanks so much :D

javerous pushed a commit to javerous/FreshRSS that referenced this issue Jan 20, 2020
Fix FreshRSS#2130
`.current` might not exist in views for which all articles are already
expanded
javerous pushed a commit to javerous/FreshRSS that referenced this issue Jan 20, 2020
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this issue Mar 25, 2021
Fix FreshRSS#2130
`.current` might not exist in views for which all articles are already
expanded
mdemoss pushed a commit to mdemoss/FreshRSS that referenced this issue Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants