• Devlin Cronin's avatar
    [Extensions] Modify GetEffectiveDocumentURL() for MatchOriginAsFallback · d46788e5
    Devlin Cronin authored
    Modify GetEffectiveDocumentURL() to take a MatchOriginAsFallbackBehavior
    to indicate in which cases the origin of a frame should be used as a
    fallback, in the case where the frame's URL is insufficient (such as
    about: and data: frames). If MatchOriginAsFallbackBehavior::kAlways is
    specified (as is the case when match_origin_as_fallback is specified as
    true in the manifest for a content script), the frame tree is no longer
    traversed.
    
    This allows scripts to inject on opaque frames where the extension has
    access to the frame's initiator, but the frame tree contains cross-
    origin frames.
    
    Update the tests for the same, and add new tests for matching a frame's
    origin as a fallback with path-specific match patterns; note that these
    are not fully supported yet.
    
    Bug: 55084
    Change-Id: I86ccf56c3b05e92851ecca3748d8d973a098522f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2343323Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Reviewed-by: default avatarNasko Oskov <nasko@chromium.org>
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#799192}
    d46788e5
script_context.cc 25.5 KB