Antonio Cardona
08/19/2024, 6:43 PMAnthony OConnor
08/19/2024, 6:49 PMAnthony OConnor
08/19/2024, 6:50 PMTim Chapman
08/19/2024, 6:50 PMAntonio Cardona
08/19/2024, 6:52 PMbattk
08/19/2024, 7:20 PMwindow.libloader = function () {
function f(a) {
const b = a.name;
if (e[b]) throw Error(`libloader - "${ b }" is allready loading`);
'Ext' === b &&
Object.assign(
a,
{
beforeLoad: () => !Error().stack.match(/\/ext-all[\w.\-]*\.js/),
afterLoad: c => {
showAlertBox(
'Ext_warning',
'This page loads a script that uses the unsupported Ext JS library ',
'The Ext JS library will be removed in NetSuite 2025.1. To prepare for this removal, you need to do one of the following: <br/> <br/>• Adjust your code to work without the use of the Ext JS library.<br/>• If you want to continue using the Ext JS library, you must replace it with your own external instance of the library.',
2
);
'complete' === document.readyState &&
c.env.Ready.handleReady()
}
}
);
e[b] = new g(a)
}
const d = Object.freeze({
NOT_LOADED: 0,
LOADING: 1,
LOADED: 2
});
class g {
constructor(a) {
this.name = a.name;
this.scripts = a.scripts;
this.stylesheets = a.stylesheets;
this.loadedSheets = [];
this.nonce = a.nonce;
this.value = null;
this.loaderInitedLoad = !1;
this.state = d.NOT_LOADED;
this.beforeLoad = a.beforeLoad ?? (() => !0);
this.afterLoad = a.afterLoad ?? (() => {
});
this.prepareOnDemandLoad()
}
loadSheets() {
const a = document.head.firstChild;
this.loadedSheets = this.stylesheets.map(
b => {
const c = document.createElement('link');
c.rel = 'stylesheet';
c.type = 'text/css';
c.href = b;
c.nonce = this.nonce;
document.head.insertBefore(c, a);
return c
}
)
}
unloadSheets() {
this.loadedSheets.forEach(a => {
a.parentNode.removeChild(a)
});
this.loadedSheets = []
}
loadScripts() {
for (const a of this.scripts) {
const b = new XMLHttpRequest;
b.open('GET', a, !1);
b.onreadystatechange = () => {
4 === b.readyState &&
(
new Function(b.responseText + `
window.${ this.name }=${ this.name };`)
).call(window)
};
b.send(null)
}
}
prepareOnDemandLoad() {
this.loadSheets();
Object.defineProperty(
window,
this.name,
{
get: () => {
this.state === d.NOT_LOADED &&
this.beforeLoad() &&
(
this.state = d.LOADING,
this.loaderInitedLoad = !0,
this.logLoad(),
this.loadScripts(),
this.afterLoad(this.value)
);
return this.value
},
set: a => {
this.value = a;
this.loaderInitedLoad ||
this.unloadSheets();
this.state = d.LOADED
}
}
)
}
logLoad() {
var a = `Dynamic load of "${ this.name }"`,
b = Error().stack;
a = {
isError: !1,
description: a,
detail: JSON.stringify({
time: (new Date).toISOString(),
title: a,
stack: b,
url: window.location.href
}),
url: window.location.href,
stack: b
};
a = 'messages=' + encodeURIComponent(JSON.stringify([a]));
b = new XMLHttpRequest;
b.open('POST', '/core/ui/log/errordbreporter.nl', !0);
b.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
b.send(a)
}
}
const e = {};
f.isLoaded = function (a) {
return e[a] ? e[a].state === d.LOADED : !!window[a]
};
return f
}();
//# sourceMappingURL=/assets/ui_libloader/2370206760.map
battk
08/19/2024, 7:21 PMbattk
08/19/2024, 7:22 PMget: () => {
this.state === d.NOT_LOADED &&
this.beforeLoad() &&
(
this.state = d.LOADING,
this.loaderInitedLoad = !0,
this.logLoad(),
this.loadScripts(),
this.afterLoad(this.value)
);
return this.value
},
battk
08/19/2024, 7:24 PMthis.state === d.NOT_LOADED
and once triggered,
this.state = d.LOADING,
meaning that there is a way to disable it, and in fact, it disables itself after running oncebattk
08/19/2024, 7:28 PMbattk
08/19/2024, 7:29 PMbattk
08/19/2024, 7:32 PMbattk
08/19/2024, 7:32 PMafterLoad: c => {
showAlertBox(
'Ext_warning',
'This page loads a script that uses the unsupported Ext JS library ',
'The Ext JS library will be removed in NetSuite 2025.1. To prepare for this removal, you need to do one of the following: <br/> <br/>• Adjust your code to work without the use of the Ext JS library.<br/>• If you want to continue using the Ext JS library, you must replace it with your own external instance of the library.',
2
);
'complete' === document.readyState &&
c.env.Ready.handleReady()
}
battk
08/19/2024, 7:32 PMshowAlertBox
Antonio Cardona
08/19/2024, 7:36 PM