<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>237643</bug_id>
          
          <creation_ts>2022-03-09 03:07:18 -0800</creation_ts>
          <short_desc>Security errors when loading PDF documents using PDF.js</short_desc>
          <delta_ts>2024-12-02 12:37:41 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>PDF</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=251887</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>235969</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mcatanzaro</cc>
    
    <cc>raphael.stonehorse</cc>
    
    <cc>thorton</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1849601</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2022-03-09 03:07:18 -0800</bug_when>
    <thetext>CONSOLE MESSAGE: webviewerloaded: SecurityError: Blocked a frame with origin &quot;webkit-pdfjs-viewer://pdfjs&quot; from accessing a cross-origin frame. Protocols, domains, and ports must match.

This happens when the pdf viewer is loaded because it tries to dispatch a custom event to the parent document:

function webViewerLoad() {
  const config = getViewerConfiguration();
  const event = document.createEvent(&quot;CustomEvent&quot;);
  event.initCustomEvent(&quot;webviewerloaded&quot;, true, true, {
    source: window
  });

  try {
    parent.document.dispatchEvent(event);
  } catch (ex) {
    console.error(`webviewerloaded: ${ex}`);
    document.dispatchEvent(event);
  }

  _app.PDFViewerApplication.run(config);
}

I have no idea why that&apos;s done, but I guess it&apos;s harmless and doesn&apos;t affect any functionality.

CONSOLE MESSAGE: Feature policy &apos;Fullscreen&apos; check failed for iframe with origin &apos;webkit-pdfjs-viewer://pdfjs&apos; and allow attribute &apos;&apos;.

This happens when the viewer checks is fullscreen is supported to enable the presentation mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1850159</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-03-10 10:18:49 -0800</bug_when>
    <thetext>&lt;rdar://problem/90106581&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2078586</commentid>
    <comment_count>2</comment_count>
    <who name="">raphael.stonehorse</who>
    <bug_when>2024-12-02 12:37:41 -0800</bug_when>
    <thetext>Any solution for this problem?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>