disable deep linking when URL .searchParams and URL .search properties are unsupported by browser. This closes
// Feature detection and browser support for URLSearchParams
if ('URLSearchParams' in window) {
+ // get the `urlSearchParams` from the URL
var urlSearchParams = new URL(window.location).searchParams;
+ // if the `urlSearchParams` are `undefined` then the browser does not support
+ // the URL object's `.searchParams` property
+ if (!nf.Common.isDefinedAndNotNull(urlSearchParams)) {
+ // attempt to get the `urlSearchParams` using the URLSearchParams constructor and
+ // the URL object's `.search` property
+ urlSearchParams = new URLSearchParams(new URL(window.location).search);
+ }
+
var groupId = nfCanvasUtils.getGroupId();
+
+ // if the `urlSearchParams` are still `undefined` then the browser does not support
+ // the URL object's `.search` property. In this case we cannot support deep links.
+ if (nf.Common.isDefinedAndNotNull(urlSearchParams)) {
var componentIds = [];
if (urlSearchParams.get('processGroupId')) {
} else {
return nfCanvasUtils.getComponentByType('ProcessGroup').enterGroup(groupId);
}
+ } else {
+ return nfCanvasUtils.getComponentByType('ProcessGroup').enterGroup(groupId);
+ }
}
},
});
// get all URL parameters
+ var url = new URL(window.location);
+
+ // get the `params` from the URL
var params = new URL(window.location).searchParams;
+ // if the `params` are undefined then the browser does not support
+ // the URL object's `.searchParams` property
+ if (!nf.Common.isDefinedAndNotNull(params)) {
+ // attempt to get the `params` using the URLSearchParams constructor and
+ // the URL object's `.search` property
+ params = new URLSearchParams(url.search);
+ }
+
+ // if the `params` are still `undefined` then the browser does not support
+ // the URL object's `.search` property. In this case we cannot support deep links.
+ if (nf.Common.isDefinedAndNotNull(params)) {
+ var params = new URLSearchParams(url.search);
params.set('processGroupId', groupId);
params.set('componentIds', selectedComponentIds.sort());
- var url = new URL(window.location);
var newUrl = url.origin + url.pathname;
if (nfCommon.isDefinedAndNotNull(nfCanvasUtils.getParentGroupId()) || selectedComponentIds.length > 0) {
window.history.replaceState({'previous_url': url.href}, window.document.title, newUrl);
}
+ }
},
/**
