An error has occurred

{{terminalError}}

Unveiling our NEW mobile app

Gain access to trusted technology news & insights that you can’t get anywhere else and SAVE 50% when you subscribe.

SUBSCRIBE & SAVE
const widget = document.querySelector('.pn-article'); const widgetScope = angular.element(widget).scope(); widgetScope.description = `Gain access to trusted technology news & insights that you can’t get anywhere else and SAVE 50% when you subscribe.`;
const targetAnchorsClass = 'a.pn-article__button'; const capturedAngularElementId = 'modal-box-image-custom-field'; changeAnchorParams(targetAnchorsClass, capturedAngularElementId); function changeAnchorParams(anchorClass, angularId) { const domElement = document.getElementById(angularId); const ngElement = angular.element(domElement); ngElement.scope().$watchCollection('params', (newParams, oldParams) => { if (newParams.url === oldParams.url) return; const userUrl = newParams.url; const paramsToReplace = (new URL(userUrl)).searchParams; if (0 === [...paramsToReplace.keys()].length) return; const anchorsToChange = document.querySelectorAll(anchorClass); if (0 === anchorsToChange.length) return; anchorsToChange.forEach((anchor) => { const anchorHref = new URL(anchor.href); const anchorSearchParams = anchorHref.searchParams; [...paramsToReplace.keys()].forEach((param) => { if (! param.startsWith('utm_') && ! param.startsWith('itm_')) return; if (anchorSearchParams.has(param)) return; anchorSearchParams.set(param, paramsToReplace.get(param)); }); const newAnchorHref = anchorHref.toString(); anchor.href = decodeURIComponent(newAnchorHref); }); }); }