Skip to content

Commit

Permalink
Update dc-converter-widget.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Blainegunn authored Oct 18, 2023
1 parent a6870ab commit fc6e3a5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions acrobat/blocks/dc-converter-widget/dc-converter-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ export default async function init(element) {
const isReturningUser = window.localStorage.getItem('pdfnow.auth');
const isRedirection = /redirect_(?:conversion|files)=true/.test(window.location.search);
const preRenderDropZone = !isReturningUser && !isRedirection;
if (VERB === 'compress-pdf' || preRenderDropZone) {
const verbFromURL = window.location.pathname.split('/').pop().split('.')[0];

const verbIncludeList = ['compress-pdf', 'fillsign', 'sendforsignature', 'add-comment',
'delete-pages', 'reorder-pages', 'split-pdf', 'insert-pdf', 'extract-pages', 'crop-pages', 'number-pages'];

if (verbIncludeList.includes(VERB) || preRenderDropZone) {
const response = await fetch(DC_GENERATE_CACHE_URL || `${DC_DOMAIN}/dc-generate-cache/dc-hosted-${DC_GENERATE_CACHE_VERSION}/${VERB}-${pageLang}.html`);
switch (response.status) {
case 200: {
Expand All @@ -223,7 +226,7 @@ export default async function init(element) {
const doc = new DOMParser().parseFromString(template, 'text/html');
document.head.appendChild(doc.head.getElementsByTagName('Style')[0]);
widgetContainer.appendChild(doc.body.firstElementChild);
performance.mark("milo-insert-snippet");
performance.mark('milo-insert-snippet');
}
break;
}
Expand Down

0 comments on commit fc6e3a5

Please sign in to comment.