Skip to content

Commit

Permalink
Cherry-pick 270274@main (58df23f). https://bugs.webkit.org/show_bug.c…
Browse files Browse the repository at this point in the history
…gi?id=260771

    REGRESSION(266247@main): PDF "Save" button does nothing, "Print" function also broken
    https://bugs.webkit.org/show_bug.cgi?id=260771

    Reviewed by Chris Dumez.

    The PDF.js viewer protocol and resource protocols both should be treated
    the same as HTTP protocols and have access to blob URLs. The protocol is
    an implementation detail that shouldn't affect how the web content
    behaves and certainly should not restrict access to web platform
    features.

    * Source/WebCore/page/SecurityOrigin.cpp:
    (WebCore::isSafelistedBlobProtocol):

    Canonical link: https://commits.webkit.org/270274@main
  • Loading branch information
mcatanzaro authored and aperezdc committed Nov 14, 2023
1 parent a8bff3c commit e337a3f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/WebCore/page/SecurityOrigin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ inline bool isSafelistedBlobProtocol(const URL& url)
// except that assert gets hit on certain tests.
return url.protocolIsInHTTPFamily()
|| url.protocolIsFile()
#if PLATFORM(GTK) || PLATFORM(WPE)
|| url.protocolIs("resource"_s)
#endif
#if ENABLE(PDFJS)
|| url.protocolIs("webkit-pdfjs-viewer"_s)
#endif
|| LegacySchemeRegistry::schemeIsHandledBySchemeHandler(url.protocol());
}

Expand Down

0 comments on commit e337a3f

Please sign in to comment.