• Marijn Kruisselbrink's avatar
    Revert "Click to Open PDF: Put placeholder HTML in IFRAMEs directly" · 2a68a0f0
    Marijn Kruisselbrink authored
    This reverts commit ad61fb27.
    
    Reason for revert: New PDFPluginDisabledTest.IframePdfPlaceholderWithCSP test is failing in https://ci.chromium.org/p/chromium/builders/luci.chromium.ci/Mac10.13%20Tests%20%28dbg%29/5617
    
    
    
    Original change's description:
    > Click to Open PDF: Put placeholder HTML in IFRAMEs directly
    > 
    > Previously, when the user has a disabled PDF plugin (or no PDF plugin)
    > and the website has an IFRAMEed PDF, when Click to Open PDF was enabled,
    > we would inject a fake <object> tag into the IFRAME to force a PDF
    > plugin placeholder to appear.
    > 
    > This approach is problematic with CSP, as CSP may forbid OBJECT tags
    > from loading in IFRAMEs.
    > 
    > This CL instead injects the placeholder HTML directly into the IFRAME.
    > 
    > In the IFRAME case, the button is now a plain link, which should allow
    > the user to click it and download the PDF even if CSP forbids <object>
    > tags or JavaScript.
    > 
    > It still may trigger a CSP warning if IFRAME is prohibited from running
    > JavaScript, but that only hurts keyboard-accessibility, and doesn't
    > prevent the mainstream use case from working.
    > 
    > This CL also prevents the <object> tag from auto-opening the PDF after
    > download, which was probably a mistake, since that overrides the user
    > configurable "Always open with system viewer" option.
    > 
    > Bug: 887752, 879149, 878871
    > Change-Id: I900c08331d2cfc96ea7cd1cd46ea594445b0920b
    > Reviewed-on: https://chromium-review.googlesource.com/c/1246956
    > Reviewed-by: Jochen Eisinger <jochen@chromium.org>
    > Reviewed-by: Lei Zhang <thestig@chromium.org>
    > Commit-Queue: Tommy Li <tommycli@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#597192}
    
    TBR=thestig@chromium.org,tommycli@chromium.org,jochen@chromium.org,mkwst@chromium.org
    
    Change-Id: I8a5554c0489ec76a4adb35ca93afef9c4354316e
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Bug: 887752, 879149, 878871
    Reviewed-on: https://chromium-review.googlesource.com/c/1265826Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
    Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#597315}
    2a68a0f0
BUILD.gn 23.4 KB