Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
3

PDF Embed API does not work on Chrome based browsers

Community Beginner ,
Mar 04, 2024 Mar 04, 2024

Hello, everyone.

 

I've been trying to get Adobe Embed API to work on Vue 3 application.

Everything works great up until I try to register a callback to Save Button.

adobeDCView.registerCallback(
  AdobeDC.View.Enum.CallbackType.SAVE_API,

  (metaData, content, options) => {
    return new Promise((resolve, reject) => {
      resolve({
        code: AdobeDC.View.Enum.ApiResponseCode.SUCCESS,
        data: {
          metaData,
        },
      });
    });
  },
  {
    autoSaveFrequency: 0,
    enableFocusPolling: false,
    showSaveButton: true,
  },
);

When I click "Save" button I get the following errors:

 

Refused to connect to 'data:application/octet-stream;base64,AGFzbQEAAAABrgd5YAJ/fwBgAn9/AX9gBH9+f38BfmADf39/AX9gAX8Bf2ACf34BfmABfwBgA39/fwBgBX9+f39/AX5gBH9/f38Bf2AFf39/f38Bf2ADf35+AX5gAn9/AX5gAn9+AX9gAn9+AGABfAF8YAN/f34Bf2AAAX9gAX8BfmAEf39/fwBgA39+fwF+YAZ/f39/f38Bf2ADf35/AGADf39/AX5gA39+fwF/YAZ/fn9/f38BfmAGf39/f39/AGAFf39/f38AYAAAYAZ/fn5/f38BfmAEf39+fwF/YAR/f39/AX5gB39/f39/f38Bf2AIf39/f39/f38Bf2AEf39/fgF/YAV/f39/fwF+YAV/f39+fgF/YAF+AX9gBX9+fn5+AGADf35+AX9gA39/fgF+YAJ8fAF8YAR/f35+AX9gBX9+f35/AX9gA39/fgBgBX9+fn9/AX5gBn9/f39/fwF+YA...YBADzmAQAAAAAA9OYBACAAAABNBAAASgQAAFN0MTZpbnZhbGlkX2FyZ3VtZW50AAAAAJzlAQDc5gEAvOYBAAAAAAAo5wEAIAAAAE4EAABKBAAAU3QxMmxlbmd0aF9lcnJvcgAAAACc5QEAFOcBALzmAQAAAAAAXOcBACAAAABPBAAASgQAAFN0MTJvdXRfb2ZfcmFuZ2UAAAAAnOUBAEjnAQC85gEAU3QxM3J1bnRpbWVfZXJyb3IAAACc5QEAaOcBADzmAQAAAAAAsOcBAK4BAABQBAAATAQAAFN0MTRvdmVyZmxvd19lcnJvcgAAnOUBAJznAQB85wEAU3Q5dHlwZV9pbmZvAAAAAHTlAQC85wEAQdzPBwslAgAAAAAAAAADAAAASgIAAEsCAABMAgAAEOgAAMDnAAAg6AAABQBBjNAHCwJDAwBBpNAHCw5EAwAARQMAAHhUAgAABABBvNAHCwEBAEHM0AcLBf////8KAEGQ0QcLBpBaAwA1BA==' because it violates the following Content Security Policy directive: "connect-src 'self' dc-api.adobe.io dc-api-v2.adobe.io p13n.adobe.io/fg/api/ sstats.adobe.com dpm.demdex.net viewlicense.adobe.io/viewsdklicense/ viewlicense.adobe.io/domainVerification/ viewlicense.adobe.io/variations/service_delivery_auth performance.typekit.net use.typekit.net p.typekit.net dc-api.adobecontent.io dc-api-v2.adobecontent.io by2.uservoice.com/t2/ pgc.adobe.io/api/discovery files.acrobat.com/api/base_uris *.adobesign.com/ *.documents.adobe.com/ cctypekit.adobe.io/v1/ bps-il.adobe.io/jil-api/users/ *.amazonaws.com commerce.adobe.com send.acrobat.com".

Refused to connect to 'data:application/octet-stream;base64,AGFzbQEAAAABrgd5YAJ/fwBgAn9/AX9gBH9+f38BfmADf39/AX9gAX8Bf2ACf34BfmABfwBgA39/fwBgBX9+f39/AX5gBH9/f38Bf2AFf39/f38Bf2ADf35+AX5gAn9/AX5gAn9+AX9gAn9+AGABfAF8YAN/f34Bf2AAAX9gAX8BfmAEf39/fwBgA39+fwF+YAZ/f39/f38Bf2ADf35/AGADf39/AX5gA39+fwF/YAZ/fn9/f38BfmAGf39/f39/AGAFf39/f38AYAAAYAZ/fn5/f38BfmAEf39+fwF/YAR/f39/AX5gB39/f39/f38Bf2AIf39/f39/f38Bf2AEf39/fgF/YAV/f39/fwF+YAV/f39+fgF/YAF+AX9gBX9+fn5+AGADf35+AX9gA39/fgF+YAJ8fAF8YAR/f35+AX9gBX9+f35/AX9gA39/fgBgBX9+fn9/AX5gBn9/f39/fwF+YA...YBADzmAQAAAAAA9OYBACAAAABNBAAASgQAAFN0MTZpbnZhbGlkX2FyZ3VtZW50AAAAAJzlAQDc5gEAvOYBAAAAAAAo5wEAIAAAAE4EAABKBAAAU3QxMmxlbmd0aF9lcnJvcgAAAACc5QEAFOcBALzmAQAAAAAAXOcBACAAAABPBAAASgQAAFN0MTJvdXRfb2ZfcmFuZ2UAAAAAnOUBAEjnAQC85gEAU3QxM3J1bnRpbWVfZXJyb3IAAACc5QEAaOcBADzmAQAAAAAAsOcBAK4BAABQBAAATAQAAFN0MTRvdmVyZmxvd19lcnJvcgAAnOUBAJznAQB85wEAU3Q5dHlwZV9pbmZvAAAAAHTlAQC85wEAQdzPBwslAgAAAAAAAAADAAAASgIAAEsCAABMAgAAEOgAAMDnAAAg6AAABQBBjNAHCwJDAwBBpNAHCw5EAwAARQMAAHhUAgAABABBvNAHCwEBAEHM0AcLBf////8KAEGQ0QcLBpBaAwA1BA==' because it violates the document's Content Security Policy.

RuntimeError: Aborted(CompileError: WebAssembly.instantiate(): Refused to compile or instantiate WebAssembly module because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self' use.typekit.net assets.adobedtm.com www.adobe.com/marketingtech/ prod.adobeccstatic.com/utilnav/ widget.uservoice.com by2.uservoice.com/t2/ assets.adobe.com api.demandbase.com/api/v2/ip.json commerce.adobe.com").

 

The funny part is, It works perfectly fine on Firefox, but not Edge or Brave Browser.  The funny thing is, when I was testing this same code couple months ago, I was not facing any issues of this sort, so I am kind of lost on what to do. Have there been any breaking changes or updates to the library?

TOPICS
Bug , How to , PDF Embed API , PDF Services API
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 04, 2024 Mar 04, 2024

Do you have a CSP defined in your app, and if so, can you *temporarily* of course, disable it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 04, 2024 Mar 04, 2024

I found some examples on stack overflow on how to add CSP policy to whitelist everything, but it did not seem to make any difference (unless I was doing it wrong). But I would imagine that it is not the issue if it works without it on Firefox.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 05, 2024 Mar 05, 2024

You got me there. Is this available online where I can test?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 06, 2024 Mar 06, 2024
LATEST

I will try creating a sample site in the upcoming day. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources