Is this a plugin or component?
I was not able to achieve the desired behaviour with a component.
You can see that itâs a plugin by looking at the GitHub repo. If thereâs a .rb
file, itâs a plugin
I know. But with iPad and the Hub is much easier to ask than start jumping around and then browsing GitHub. But the main reason is not pure lazyness (this timeâŚ), but iPad will be low in memory and the OS kills DiscourseHub.
But sure â telling .rb
-trick is generally more informatic and useful way.
I could trust on @Thoka when said in the beginning it is a plugin, but for some really strange reason I didnât that.
Does this require the theme component or works without?
You donât need the theme. It works without. There are also no configuration options. Once installed, every PDF will be readable right in the browser.
Awesome thank you snd thanks for creating this new plugin.
@thoka Teeeeee-rrrrrrrriffffffic!!! Thank you so much!!!
First thing to say is that the component works perfectly fine for me with S3, displaying inline previews.
One of our forum members has a particularly risk-averse approach to the internet. Heâs using Firefox with the application behaviour setting changed to download PDF files rather than displaying in the browser.
When he opens up a particular topic where the PDF has previously been uploaded, Firefox automatically downloads the file every time. Heâs technically competant, though I canât vouch for his skills or experience, and has already tried this:
Overriding the CSS client side with âiframe.pdf-preview { display: none!important; }â hides the âpreviewâ but Firefox still downloads the blob.
The obvious answer is to change the browser setting to preview the file in Firefox but itâs not my place to tell others how to maintain their own security profile online, at least not without trying to find another solution. Any ideas?
You could create another theme that s user selectable and not include the theme component on that theme. The user would need to select the theme from their profile.
Thatâs an interesting workaround but perhaps somewhat âthrowing the baby out with the bath waterâ.
They do have a choice to use the Redditish theme. Pretty much everyone seems to want to stay with the familiar. I will keep it in mind.
Youâre dealing with a user who is intentionally breaking your site and then complaining about it. If he doesnât want inline pdf how is giving him the opportunity not to have them throwing anything away?
Heâs complaining about the repeated downloading of a PDF thatâs a conseqence of his choice of his preferred browser settings. On the basis of âyou canât please all of the people all of the timeâ, heâll have to live with this one.
Nothing heâs doing will break the site for anyone else. If he finds a way to make something work for himself Iâd call that a legitimate hack.
Hi,
Is there any update about new tab?
Thanks.
We are using Discourse send PDF inline to read locally uploaded PDFs in the browser.
hi
this is my PDF preview
this is console errors
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://cdn.my_site.com/original/1X/0d281938d3ff2377541704cab6ba1c4408420733.pdf. (Reason: CORS header âAccess-Control-Allow-Originâ missing). Status code: 200.
the problem there is an image work 100%
https://cdn.my_site.com/optimized/1X/b8e363026da621558d8c2a8159a4a7671eaf0285_2_1035x685.jpeg
this PDF link with broken preview
https://my_site.com/uploads/short-url/1So7iQsrmIZKLQ6UGI86B1cOqD9.pdf
i am using CloudFront as CDN.
here is s3 setting
my site S3
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"http://my_site.com",
"https://my-test-site.site", # my test site use the same bucket.
"https://cdn.my_site.com",
"https://URL.cloudfront.net"
],
"ExposeHeaders": [
"Access-Control-Allow-Origin"
]
}
]
i am missing something hereâŚ
Take a look at the cors origin admin setting.
i did add my cdn.my_site to cors origin
/admin/site_settings/category/all_results?filter=cors origin
or did you mean something else!
That is what I meant. If that did not fix it for you then you will have to dig further. There is some discussion in this topic please search for it and let us know how it goes! We could then update the first post with a solution.
I did fix it, But almost lost my mind.
I did tons of ârebuild the appâ and once reinstalled the Ubuntu it self. Not sure what was wrong. In the process did fix upload assets to AWS S3
.
Then i kept tying with the same PDF in the same topic with no solution.
Finally i give up, and later did upload PDF to other topic and itâs work.