I registered my JavaScript function on Dynamics 365 form:
My code works fine (the result TypeScript transpiling):
var Softline_Stuff;
(function (Softline_Stuff) {
function hello() {
alert("Hello, World! v2");
}
Softline_Stuff.hello = hello;
})(Softline_Stuff || (Softline_Stuff = {}));
//# sourceMappingURL=isv_stuff.js.map
But if I try to find according script element which contains my code then I found nothing. I run this code in browser's console (Google Chrome):
// Search inside of main document and child documents are located in iframes:
let docs = [document];
for(let frameIndex = 0; frameIndex < frames.length; frameIndex++) {
docs = [...docs, frames[frameIndex].document];
}
for(let doc of docs) {
const tags = doc.getElementsByTagName('script');
for(let index = 0; index < tags.length; index++) {
// Check src attribute value
const path = tags[index].getAttribute("src");
if(path && path.includes("isv_")){
console.log(path);
}
// if src value is null it means script is inlined
else if(!path) {
const code = tags[index].textContent;
// My code contains this string:
if(code && code.includes("Hello, World!")){
console.log(code);
}
}
}
}
How to find script element which contains my code directly or points to it through scr attribute?

