Inline PDF Previews

Hmm, not sure why you don’t see the pdf, but it works fine for me on your site here. Do you have any plugins or ad blockers active in your browser(s)?

3 Likes

Works well for me too, even with secure media

2 Likes

In iPad? I don’t think so. Then the issue is more or less Safari itself. And DiscourseHub is just another Safari too.

Anyway — It is broken if it doesn’t work on every supported browsers and devices. But there must be some funny things happening and I don’t know if it comes from Apple or the component.

I would blame DiscouseHub for that I don’t see nothing more than just a grey box. But using Safari itself I see the very first page, nothing else, and I don’t see that toolbox either.

All I get on Safari/iPad is just pure nice first page.

1 Like

Ah, I see. I can reproduce that on my iPad too - only page 1 of the PDF is shown in all browsers.

However, that may be because:

2 Likes

Of course :man_facepalming:

(I really really hope this coding way isn’t coming more common. Such functuonality that is not at least hidden on every mobiles should counted as broken because it breaks so hard UX of majority of users. Sure — an admin makes decision when install on not, but still)

1 Like

This is what I’m seeing in Edge and Chrome desktop (both browsers have no plugins installed)

the source seems empty frame:
image

no relevant error in Discourse logs

1 Like

Do you see anything in the javascript console?

1 Like

This seems to me like a difficult issue to troubleshoot, without specific and clear repro steps.

For me, the theme component appears to be working as advertised. I use it all the time and really appreciate it.

  • on my macbook pro and chrome, I see the pdf preview just like the screenshot in the OP.
  • on my iphone and chrome and safari, I see the PDF link with no preview, just like the OP describes.
1 Like

Install normally and upload a PDF-file :wink:

And yet here is now three who has issues.

I don’t know either how to go further. If you guys can’t see any issues and we don’t get any errors the situation is impossible to solve. Sure, I could remove all components, but honestly — this is not that big thing to me, and I’m a bit lazy, so… :wink:

1 Like

Clear repro steps would be really helpful instead of just complaining. What browser, version, etc. Any errors in the javascript console? Conflicting plugins or theme component? If you don’t feel like providing it then maybe some others here can do it. Thanks!

Like I said, this plugin works just as advertised for me on all devices I use.

Really indeed. I actually gave it, because it has never worked.

Good for you.

What ever. It does not work to me. And I’m not the only one. And after that attitude I lost my interest totally. I was just unistalling all components and trying to find if there is some strange conflicts but I can totally live without it.

Did you provide reproducible steps? Sorry this is a long topic and I guess I missed it. Please point me to it and I will try to use them to see the problem so I can look into how we might fix it.

If you like you can also invite me to your community so I can see if my experience on your site is different from yours.

This is really not an esoteric bug that only happens within some sub-version of the browser. It appears that for some users (at least myself and @Jagster ) it never worked on any browser, on any version, even with freshly installed browser and no browser-addons installed.
I’m attaching my list plugins just in case it could be a conflict with one of them?
Otherwise, like was said before, there are no particular steps other than enabling the component, setting it to “inline” mode and that’s it.

plugin version
discourse-assign
Assign users to topics
1.0.1
discourse-bbcode-color
A Discourse plugin to support BBCode color tags.
0.2
discourse-cakeday
Show a birthday cake beside the user’s name on their birthday and/or on the date they joined Discourse.
0.3
discourse-calendar
Display a calendar in the first post of a topic
0.3
discourse-checklist
Add checklist support to Discourse
0.4.1
discourse-docs
A plugin to make it easy to explore and find knowledge base documents in Discourse
0.1
discourse-math
Official mathjax plugin for Discourse
0.9
discourse-plugin-site-setting-override
Example plugin to override a site setting
1.0.0
discourse-policy
Apply policies to Discourse topics
0.1
discourse-reactions
Allows users to react with emojis to a post
0.2
discourse-shared-edits
Edit posts collaboratively in Discourse
0.1.0
discourse-teambuild
Team Building Exercise for Discourse
0.0.1
discourse-topic-voting
Adds the ability to vote on features in a specified category.
0.5
discourse-whos-online
Display a list of online users at the top of the screen
2
docker_manager
Docker manager for Discourse image
0.1

EDIT:
Sorry I didn’t think about it before, but I can see error in the browser console:

Access to fetch at 'https://ddhctjh.s3.us-east-2.amazonaws.com/original/2X/d/d9b0bb43744e74691b087.pdf?X-Amz-Algorithm=..............' (redirected from 'https://dfgdfg.dfg/secure-uploads/original/2X/d/d9b0bb474687.pdf') from origin '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
2 Likes

Let me do a test here. Temporarily enabled the plugin. Works for me? How about for you? (edit: removed theme component after testing - confirmed working for me and @Alon1)

sample-pdf-with-images.pdf (3.8 MB)

2 Likes

Cool! That error might help others to pinpoint the source of the problem on your site.

2 Likes

yes!

2 Likes

I can confirm that the plugin WORKS if I install a browser plugin: https://mybrowseraddon.com/access-control-allow-origin.html and toggle CORS on.
Of course, this is not a solution, but may shed light on the issue.

2 Likes

I have no idea what that CORS error means. But seems you are homing in on the cause of your problem!

2 Likes

As far as I understand this is a cross-domain issue. Because I store files on S3 (“enable s3 uploads”) the domain of the assets is amazonaws.com which is different than the domain of my Discourse installation.

2 Likes

maybe you need to look at the cors origins admin setting?

3 Likes