So recently I'm developing a CRX extension, and I need to transfer some of JSON-formatted data from page to content-script, but the problem I encountered is that native JSON.stringify function is rewrited by some JS in the page, So the following JS does not work.
var dataBridge = document.createElement('script'); dataBridge.type = 'text/javascript'; document.body.setAttribute('dataBridge',JSON.stringify(PageData)); document.head.appendChild(dataBridge); document.head.removeChild(dataBridge); PageData = document.body.getAttribute('dataBridge'); PageData = JSON.parse(PageData);
So, is it possible for me to access native functions if it is "Hijacked"?, If not, am I possible to transfer those JSON-formatted data by some methods else? I'm afraid that I cannot just write lots of quotes, which can make my code hardly to be obfuscated.