@coderprowin

Как решить ошибку выполнения скрипта js в delphi?

Проблема в общем такова.
Есть функции js
function myAwesomeStealedFunction() {
  var e=function(){return document.domain?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("44cd9d1d743232bec9c1f1d2643733be"),function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d06a6a4a55bd50c554e38c184aede1ae")):""}();return e=function(){return document.documentElement?function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(e,function(e){if(typeof location!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9fa1769224069d6f85df8f840b102105")):""}(),e=function(){return document.documentElement?e+function(e,t){t||(t=e);var n=e.split(t[2]),r="";for(var i=n.length-1;i>=0;i--)r=r+n[i]+t[i%t.length];return r}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("01b35fa43b635e90f0a65b6fc4da6d09"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("b6c3e9fe349bc1d4b4a0717c5c6580d0")):""}(),e=function(){return document.styleSheets?e+function(e,t){var n=t&&t.charCodeAt(0)%26||e.charCodeAt(3)%26,r=-1,i=e.replace(/[a-zA-Z]/g,function(e){return r+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(r%t.length))%26+n+(e<="Z"?90:122)-26)?e:e-26)});return i}(function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("cc061df6226b138a339aa7dfbf43f0ba"),function(e){if(typeof navigator!="undefined"&&typeof navigator.appName!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("d9bb30e8e560c9180a41ddfc96cf12bd")):""}(),e=function(){return document.characterSet?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof location!="undefined"&&typeof location.host!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("9f939d8e0a555d764cb5c7e8ff53fdb3")):""}(),e=function(){return document.documentElement?function(e,t){var n=-1,r=e.replace(/[a-zA-Z]/g,function(e){return n+=1,String.fromCharCode((e<="Z"?90:122)>=(e=(e.charCodeAt(0)+t.charCodeAt(n%t.length))%26+13+(e<="Z"?90:122)-26)?e:e-26)});return r}(e,function(e){if(typeof screen!="undefined"){var t=e.charCodeAt(0)%e.length,n=e.substring(t)+e.substring(0,t);return n}return b}("e2fad677976e57127d82363cb9eef5bc")):""}(),e+=function(e,t){return typeof navigator!="undefined"&&typeof navigator.appName!="undefined"?t:e}("a63534b39fa4a786","c44baadbecf07e54"),e
}

myAwesomeStealedFunction()


В консоли браузера все выполняется окей.
Как только закидаю в memo функцию и пытаюсь выполнить через MSScriptControl , приходит ошибка :
"document" - определение отсутствует.
Как решить данную проблему, и как его определить?
  • Вопрос задан
  • 328 просмотров
Пригласить эксперта
Ответы на вопрос 1
В клиентском окружении нету document. Он есть только в браузерах, как и window.

Делайте еще проверку на this['document']
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы