Lee Evans

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
in reply to: Embeded PDF Viewer gives script error #181140

Lee Evans
Participant

Also on our WordPress .htaccess I’ve commented out the CSP rules, but wouldn’t expect it to be these anyway.


# X-XSS-Protection
#Header set X-XSS-Protection "1; mode=block"

# X-Frame-Options
#   Header add Content-Security-Policy "default-src 'self'; script-src: 'self' 'unsafe-inline';"

# X-Content-Type nosniff
#Header set X-Content-Type-Options nosniff

I’ve hacked a workaround by loading the pdf directly into an iframe.

In docViewer function in FileSystem.php

replaced this line:-

$doc_preview_html = '<iframe src="https://docs.google.com/viewer?url=' . urlencode($url) . '&embedded=true" width="100%" height="600" style="border: none;"></iframe>';

with
$doc_preview_html = '<iframe class="documentsIframe" src="'.$url.'" title="Preview Document" style="width: 100%;height: 1000px;"></iframe>';

Can anyone suggest an easier way to make a shortcode and have access to the file URL outside of the plugin – or at least make the google doc viewer work?

  • This reply was modified 2 years, 5 months ago by Lee Evans.
in reply to: Embeded PDF Viewer gives script error #181138

Lee Evans
Participant

I do have this CORS policy on the bucket already:-

[
    {
        "AllowedHeaders": [],
        "AllowedMethods": [
            "GET"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]
  • This reply was modified 2 years, 5 months ago by Lee Evans.
Viewing 2 posts - 1 through 2 (of 2 total)