IITC-CE / ingress-intel-total-conversion

intel.ingress.com total conversion user script with some new features. Should allow easier extension of the intel map.
https://iitc.app
ISC License
284 stars 110 forks source link

eval() blocked by Firefox #386

Closed MysticJay closed 4 years ago

MysticJay commented 4 years ago

https://github.com/IITC-CE/ingress-intel-total-conversion/blob/3f4867a4a4ab5dd86d093fcaa9829f3267f70e9b/core/code/chat.js#L777

Firefox blocks execution of eval(). the result is an Error in the console.

Content Security Policy: The page’s settings blocked the loading of a resource at eval (“script-src”). Source: (function(a,B,u,V){let n,m,b,w,H,y,S,G,ea,t,fa,L,ka;const d={};let e={safeWindow:d,safeDocument:{},eval,Context:{D:V},exec_fn:function(a,b,e){n(new d.Function(a),b,e)},exec_csp:function(a,b,d){const c=u${19831206*e.Context.M_r()+1};e.Message.send("csp",{id:c,src:a});e.exec_script(c,b,d)},exec_script:function(b,d,e){const c=a[b];delete a[b];n(c,d,e)}};const I=(b,d)=>{a.console.error(Tampermonkey sandbox preparation ${d?"("+`

McBen commented 4 years ago

can't confirm.
And would be really bad for any webpack-development code.

How do you run the "debug" chat tab on firefox? I'm not even sure if this code is used on mobile.

McBen commented 4 years ago

grafik faked a debug tab

McBen commented 4 years ago

I believe this error message is sync-plugin / google api related.

MysticJay commented 4 years ago

Wasn't the line with the eval introduced for ulog? I was also wondering how it got executed, but it ws the only one found in the code.

Google API is a good guess, at it causes more messages, that maybe can be avoided by not loading that from the web.

johnd0e commented 4 years ago

Wasn't the line with the eval introduced for ulog?

I has nothing with ulog. And I even have no idea how to enable that 'debug' tab. It is sort of legacy code and we have no plans to support it anyway.