'TypeError: Cannot read properties of undefined (reading 'runtime')
I just upgraded to Google Chrome 100.0.4896.127 and I'm seeing the following error in my Angular 13 application in the console:
Uncaught TypeError: Cannot read properties of undefined (reading 'runtime')
at webcontent.js:1:280
at webcontent.js:2:463
at webcontent.js:2:467
I don't see this error in any other browser that I use (i.e. Microsoft Edge). What changed for this to appear? I'm not sure how to go about fixing it.
This is what webcontent.js looks like. This is not a script that I made. I'm assuming it's coming from Angular.
'use strict';
(function(d) {
(function() {
function e(a, b) {
switch (a) {
case "SCRIPT":
return `<${a}>function sef() { ${b} }</${a}>`;
case "PHONENUMBER":
return b.match(/((?!-)\+?(?:[0-9\(\)\/-](?!\/)(?!\n)\s?){7,19}[0-9])(?=\s|\.|;|'|"|\n|$)/g)
}
return null
}
const c = d.SEFAgent.browserObject.runtime.connect({
name: "webcontent"
})
, f = d.SEFAgent;
class k {
constructor(a=!1) {
this.set = a ? new WeakSet : new Set
}
dedup(a) {
if (this.set.has(a))
return !1;
this.set.add(a);
return !0
}
}
const g = f.observerManager.CreateObserver((a,b)=>{
c && c.postMessage({
type: "script",
buffer: e(b.target.nodeName, b.target.textContent)
})
}
, {
parent: {
include: ["SCRIPT"]
}
})
, l = new k
, h = f.observerManager.CreateObserver(a=>{
c && (a = e("PHONENUMBER", a.textContent)) && (a = a.filter(a=>l.dedup(a)),
0 < a.length && c.postMessage({
type: "phonenumber",
buffer: a
}))
}
, {
parent: {
exclude: ["SCRIPT", "STYLE", "NOSCRIPT"]
},
node: {
include: ["#text", "DIV"]
}
});
c.onMessage.addListener(a=>{
switch (a.type) {
case "stop":
g.Stop(),
h.Stop()
}
}
);
g.Start();
h.Start()
}
)()
}
)(this);
The error is coming from this line d.SEFAgent.browserObject.runtime.connect
. I can't upgrade or downgrade the Chrome version. It's managed by my company. Any help would be appreciated!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|