Skip to content

Commit

Permalink
Merge branch 'stage' into loadareatest4
Browse files Browse the repository at this point in the history
  • Loading branch information
peller authored Aug 21, 2023
2 parents d80f434 + d08ace8 commit 8ec9e43
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions acrobat/blocks/dc-converter-widget/dc-converter-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ const pageLang = localeMap[langFromPath] || 'en-us';
export default async function init(element) {
element.closest('main > div').dataset.section = 'widget';
const widget = element;
const DC_WIDGET_VERSION_FALLBACK = '2.40.0_1.172.1';
const DC_GENERATE_CACHE_VERSION_FALLBACK = '1.172.1';
const DC_WIDGET_VERSION_FALLBACK = '3.7.1_2.14.0';
const DC_GENERATE_CACHE_VERSION_FALLBACK = '2.14.0';
const STG_DC_WIDGET_VERSION = document.querySelector('meta[name="stg-dc-widget-version"]')?.getAttribute('content');
const STG_DC_GENERATE_CACHE_VERSION = document.querySelector('meta[name="stg-dc-generate-cache-version"]')?.getAttribute('content');

Expand All @@ -132,13 +132,17 @@ export default async function init(element) {
sampleRate: 1,
tags: 'Cat=DxDC_Frictionless,origin=milo',
};
// LANA
window.dcwErrors = [];
if (!DC_WIDGET_VERSION) {
DC_WIDGET_VERSION = DC_WIDGET_VERSION_FALLBACK;
window.lana?.log(`DC WIDGET VERSION IS NOT SET, USING FALLBACK VERSION: ${DC_WIDGET_VERSION_FALLBACK}`, lanaOptions);
dcwErrors.push(`DC WIDGET VERSION IS NOT SET, USING FALLBACK VERSION: ${DC_WIDGET_VERSION_FALLBACK}`);
}
if (!DC_GENERATE_CACHE_VERSION) {
DC_GENERATE_CACHE_VERSION = DC_GENERATE_CACHE_VERSION_FALLBACK;
window.lana?.log(`DC GENERATE CACHE VERSION IS NOT SET, USING FALLBACK VERSION: ${DC_GENERATE_CACHE_VERSION_FALLBACK}`, lanaOptions);
dcwErrors.push(`DC GENERATE CACHE VERSION IS NOT SET, USING FALLBACK VERSION: ${DC_GENERATE_CACHE_VERSION_FALLBACK}`);
}
let WIDGET_ENV = `https://dev.acrobat.adobe.com/dc-hosted/${DC_WIDGET_VERSION}/dc-app-launcher.js`;
let ENV = 'dev';
Expand Down
9 changes: 7 additions & 2 deletions acrobat/scripts/dcLana.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,21 @@ export default function lanaLogging() {
}
}, 10000);

window.dcwErrors?.forEach((error) => {
lanaOptions.tags = 'Cat=DxDC_Frictionless,origin=milo';
window.lana.log(error, lanaOptions);
});

// Content Security Policy Logging
if (fricPage) {
window.cspErrors.forEach((error) => {
window.cspErrors?.forEach((error) => {
lanaCspOptions.tags = 'Cat=DxDC_Frictionless_CSP,origin=milo';
window.lana.log(error, lanaCspOptions);
})

document.addEventListener("securitypolicyviolation", (e) => {
lanaCspOptions.tags = 'Cat=DxDC_Frictionless_CSP,origin=milo';
window.lana.log(`${e.violatedDirective} violation ¶ Refused to load content from ${e.blockedURI}`, lanaCspOptions);
});
});
}
}
2 changes: 2 additions & 0 deletions acrobat/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,10 @@ const { ietf } = getLocale(locales);
loadArea, loadScript, setConfig, loadLana, getMetadata
} = await utilsPromise;
addLocale(ietf);

setConfig({ ...CONFIG, miloLibs });
loadLana({ clientId: 'dxdc' });

// get event back from dc web and then load area
await loadArea(document, false);

Expand Down

0 comments on commit 8ec9e43

Please sign in to comment.