Last active
March 24, 2022 09:34
-
-
Save Aries0d0f/ff75d92126cef127c2d04c2707fc2300 to your computer and use it in GitHub Desktop.
AGH Debugger
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.createTemplateTagFirstArg=function(a){return a.raw=a};$jscomp.createTemplateTagFirstArgWithRaw=function(a,b){a.raw=b;return a};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)}; | |
$jscomp.arrayFromIterator=function(a){for(var b,d=[];!(b=a.next()).done;)d.push(b.value);return d};$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1; | |
$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,d){if(a==Array.prototype||a==Object.prototype)return a;a[b]=d.value;return a};$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var d=a[b];if(d&&d.Math==Math)return d}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this); | |
$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var d=$jscomp.propertyToPolyfillSymbol[b];if(null==d)return a[b];d=a[d];return void 0!==d?d:a[b]}; | |
$jscomp.polyfill=function(a,b,d,c){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,d,c):$jscomp.polyfillUnisolated(a,b,d,c))};$jscomp.polyfillUnisolated=function(a,b,d,c){d=$jscomp.global;a=a.split(".");for(c=0;c<a.length-1;c++){var e=a[c];if(!(e in d))return;d=d[e]}a=a[a.length-1];c=d[a];b=b(c);b!=c&&null!=b&&$jscomp.defineProperty(d,a,{configurable:!0,writable:!0,value:b})}; | |
$jscomp.polyfillIsolated=function(a,b,d,c){var e=a.split(".");a=1===e.length;c=e[0];c=!a&&c in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var g=0;g<e.length-1;g++){var h=e[g];if(!(h in c))return;c=c[h]}e=e[e.length-1];d=$jscomp.IS_SYMBOL_NATIVE&&"es6"===d?c[e]:null;b=b(d);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==d&&(void 0===$jscomp.propertyToPolyfillSymbol[e]&&(d=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE? | |
$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+d+"$"+e),$jscomp.defineProperty(c,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},b={};try{return b.__proto__=a,b.a}catch(d){}return!1}; | |
$jscomp.setPrototypeOf=$jscomp.TRUST_ES6_POLYFILLS&&"function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null;$jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");}; | |
$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};$jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1}; | |
$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(a){this.yieldResult=a};$jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype["return"]=function(a){this.abruptCompletion_={"return":a};this.nextAddress=this.finallyAddress_}; | |
$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(a,b){this.nextAddress=b;return{value:a}};$jscomp.generator.Context.prototype.yieldAll=function(a,b){var d=$jscomp.makeIterator(a),c=d.next();$jscomp.generator.ensureIteratorResultIsObject_(c);if(c.done)this.yieldResult=c.value,this.nextAddress=b;else return this.yieldAllIterator_=d,this.yield(c.value,b)}; | |
$jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(a,b){this.catchAddress_=a;void 0!=b&&(this.finallyAddress_=b)};$jscomp.generator.Context.prototype.setFinallyBlock=function(a){this.catchAddress_=0;this.finallyAddress_=a||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(a,b){this.nextAddress=a;this.catchAddress_=b||0}; | |
$jscomp.generator.Context.prototype.enterCatchBlock=function(a){this.catchAddress_=a||0;a=this.abruptCompletion_.exception;this.abruptCompletion_=null;return a};$jscomp.generator.Context.prototype.enterFinallyBlock=function(a,b,d){d?this.finallyContexts_[d]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=a||0;this.finallyAddress_=b||0}; | |
$jscomp.generator.Context.prototype.leaveFinallyBlock=function(a,b){var d=this.finallyContexts_.splice(b||0)[0];if(d=this.abruptCompletion_=this.abruptCompletion_||d){if(d.isException)return this.jumpToErrorHandler_();void 0!=d.jumpTo&&this.finallyAddress_<d.jumpTo?(this.nextAddress=d.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=a};$jscomp.generator.Context.prototype.forIn=function(a){return new $jscomp.generator.Context.PropertyIterator(a)}; | |
$jscomp.generator.Context.PropertyIterator=function(a){this.object_=a;this.properties_=[];for(var b in a)this.properties_.push(b);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;0<this.properties_.length;){var a=this.properties_.pop();if(a in this.object_)return a}return null};$jscomp.generator.Engine_=function(a){this.context_=new $jscomp.generator.Context;this.program_=a}; | |
$jscomp.generator.Engine_.prototype.next_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,a,this.context_.next_);this.context_.next_(a);return this.nextStep_()}; | |
$jscomp.generator.Engine_.prototype.return_=function(a){this.context_.start_();var b=this.context_.yieldAllIterator_;if(b)return this.yieldAllStep_("return"in b?b["return"]:function(d){return{value:d,done:!0}},a,this.context_["return"]);this.context_["return"](a);return this.nextStep_()}; | |
$jscomp.generator.Engine_.prototype.throw_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],a,this.context_.next_);this.context_.throw_(a);return this.nextStep_()}; | |
$jscomp.generator.Engine_.prototype.yieldAllStep_=function(a,b,d){try{var c=a.call(this.context_.yieldAllIterator_,b);$jscomp.generator.ensureIteratorResultIsObject_(c);if(!c.done)return this.context_.stop_(),c;var e=c.value}catch(g){return this.context_.yieldAllIterator_=null,this.context_.throw_(g),this.nextStep_()}this.context_.yieldAllIterator_=null;d.call(this.context_,e);return this.nextStep_()}; | |
$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var a=this.program_(this.context_);if(a)return this.context_.stop_(),{value:a.value,done:!1}}catch(b){this.context_.yieldResult=void 0,this.context_.throw_(b)}this.context_.stop_();if(this.context_.abruptCompletion_){a=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(a.isException)throw a.exception;return{value:a["return"],done:!0}}return{value:void 0,done:!0}}; | |
$jscomp.generator.Generator_=function(a){this.next=function(b){return a.next_(b)};this["throw"]=function(b){return a.throw_(b)};this["return"]=function(b){return a.return_(b)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(a,b){var d=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b));$jscomp.setPrototypeOf&&a.prototype&&$jscomp.setPrototypeOf(d,a.prototype);return d}; | |
$jscomp.asyncExecutePromiseGenerator=function(a){function b(c){return a.next(c)}function d(c){return a["throw"](c)}return new Promise(function(c,e){function g(h){h.done?c(h.value):Promise.resolve(h.value).then(b,d).then(g,e)}g(a.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(a){return $jscomp.asyncExecutePromiseGenerator(a())};$jscomp.asyncExecutePromiseGeneratorProgram=function(a){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(a)))}; | |
(function(){var a=function(c,e){return $jscomp.asyncExecutePromiseGeneratorProgram(function(g){return g["return"](new Promise(function(h,l){var f=new XMLHttpRequest;f.withCredentials=!0;f.open(c,e);f.send();f.onreadystatechange=function(){4===f.readyState&&h(JSON.parse(f.response))};f.addEventListener("error",l)}))})},b=function(){var c,e,g,h,l,f;return $jscomp.asyncExecutePromiseGeneratorProgram(function(k){if(1==k.nextAddress)return c=document.documentElement,e=document.querySelector("[agh-viewport]>.viewport-container"), | |
g=location,k.yield(a("GET","/api/version"),2);if(3!=k.nextAddress)return h=k.yieldResult,l={name:"UI",version:c.getAttribute("data-agh-ui-version")},k.yield(a("GET","/api/users/me"),3);f=k.yieldResult;f.user.profile=JSON.parse(f.user.profile);f.organization.profile=JSON.parse(f.organization.profile);f.organization.payload=JSON.parse(f.organization.payload);return k["return"]({BoundingBox:{screen:{id:window.screen.id,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,availLeft:window.screen.availLeft, | |
availTop:window.screen.availTop,height:window.screen.height,width:window.screen.width,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,scaleFactor:window.screen.scaleFactor,top:window.screen.top,left:window.screen.left,orientation:window.screen.orientation,internal:window.screen.internal,primary:window.screen.primary,touchSupport:window.screen.touchSupport},DOM:c.getBoundingClientRect(),viewport:e.getBoundingClientRect()},UA:navigator.userAgent,route:g,version:[].concat($jscomp.arrayFromIterable(h.versions), | |
[l]),account:f})})};(function(){var c,e,g,h,l,f,k,p,q,r,t,u,v;return $jscomp.asyncExecutePromiseGeneratorProgram(function(n){if(1==n.nextAddress)return n.yield(b(),2);c=n.yieldResult;u="\n<pre>\n## Version\n"+c.version.map(function(m){return m.name+" `"+m.version+"`"}).join("\n")+"\n\n## Browser\n"+d("User-Agent: "+c.UA)+"\n\n### Screen\n`"+c.BoundingBox.screen.availWidth+"` x `"+c.BoundingBox.screen.availHeight+"` (`"+c.BoundingBox.screen.width+"` x `"+c.BoundingBox.screen.height+"` @ HiDPI "+(c.BoundingBox.screen.scaleFactor|| | |
1)+"x)\n\n## Configuration\n### Accessibility\n"+(null==(h=Object.entries((null==(e=c.account.user.profile)?void 0:null==(g=e.setting)?void 0:g.accessibility)||[]))?void 0:h.map(function(m){return m[0]+" `"+(m[1]?"ON":"OFF")+"`"}).join("\n"))+"\n\n### Localization\nLanguage `"+((null==(l=c.account.user.profile)?void 0:null==(f=l.setting)?void 0:f.langCode)||"Default (unset)")+"`\nRegion `"+((null==(k=c.account.user.profile)?void 0:null==(p=k.setting)?void 0:p.regionCode)||"Default (unset)")+"`\nTime Zone `"+ | |
((null==(q=c.account.user.profile)?void 0:null==(r=q.setting)?void 0:null==(t=r.datetime)?void 0:t.timeZone)||"Default (unset)")+"`\n\n## Route\n["+c.route.href+"]("+c.route.href+")\n\n## RAW Payload\n</pre>\n<pre>\n<xmp><details>\n\n"+d(c,"json")+"\n\n</details></xmp></pre>";v=window.open("","_blank");v.document.write(u);n.jumpToEnd()})})();var d=function(c,e){e=void 0===e?"":e;return"```"+e+"\n"+("json"===e?JSON.stringify(c,null,2):c)+"\n```\n"}})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
/* | |
* ArgusHack debugger script | |
*/ | |
// Easy AJAX | |
const http$ = async (method, endpoint) => new Promise((resolve, reject) => { | |
const xhr = new XMLHttpRequest(); | |
xhr.withCredentials = true; | |
xhr.open(method, endpoint); | |
xhr.send(); | |
xhr.onreadystatechange = () => { | |
if (xhr.readyState === 4) { | |
resolve(JSON.parse(xhr.response)); | |
} | |
} | |
xhr.addEventListener('error', reject); | |
}); | |
// Getting Information | |
const getEnvironmentInfo = async () => { | |
const DOM = document.documentElement; | |
const viewport = document.querySelector('[agh-viewport]>.viewport-container'); | |
const route = location; | |
const version = await http$('GET', '/api/version'); | |
// Get UI version | |
const UIVersion = { name: 'UI', version: DOM.getAttribute('data-agh-ui-version')}; | |
const account = await http$('GET', '/api/users/me'); | |
account.user.profile = JSON.parse(account.user.profile); | |
account.organization.profile = JSON.parse(account.organization.profile); | |
account.organization.payload = JSON.parse(account.organization.payload); | |
return { | |
BoundingBox: { | |
screen: { | |
id: window.screen.id, | |
availHeight: window.screen.availHeight, | |
availWidth: window.screen.availWidth, | |
availLeft: window.screen.availLeft, | |
availTop: window.screen.availTop, | |
height: window.screen.height, | |
width: window.screen.width, | |
colorDepth: window.screen.colorDepth, | |
pixelDepth: window.screen.pixelDepth, | |
scaleFactor: window.screen.scaleFactor, | |
top: window.screen.top, | |
left: window.screen.left, | |
orientation: window.screen.orientation, | |
internal: window.screen.internal, | |
primary: window.screen.primary, | |
touchSupport: window.screen.touchSupport | |
}, | |
DOM: DOM.getBoundingClientRect(), | |
viewport: viewport.getBoundingClientRect() | |
}, | |
UA: navigator.userAgent, | |
route, | |
version: [ | |
...version.versions, | |
UIVersion | |
], | |
account | |
}; | |
} | |
// Output Format | |
(async () => { | |
const metadata = await getEnvironmentInfo(); | |
const template = ` | |
<pre> | |
## Version | |
${metadata.version.map((app) => `${app.name} \`${app.version}\``).join('\n')} | |
## Browser | |
${code$(`User-Agent: ${metadata.UA}`)} | |
### Screen | |
\`${metadata.BoundingBox.screen.availWidth}\` x \`${metadata.BoundingBox.screen.availHeight}\` (\`${metadata.BoundingBox.screen.width}\` x \`${metadata.BoundingBox.screen.height}\` @ HiDPI ${metadata.BoundingBox.screen.scaleFactor || 1}x) | |
## Configuration | |
### Accessibility | |
${Object.entries(metadata.account.user.profile?.setting?.accessibility || [])?.map((option) => `${option[0]} \`${option[1] ? 'ON' : 'OFF'}\``).join('\n')} | |
### Localization | |
Language \`${metadata.account.user.profile?.setting?.langCode || 'Default (unset)'}\` | |
Region \`${metadata.account.user.profile?.setting?.regionCode || 'Default (unset)'}\` | |
Time Zone \`${metadata.account.user.profile?.setting?.datetime?.timeZone || 'Default (unset)'}\` | |
## Route | |
[${metadata.route.href}](${metadata.route.href}) | |
## RAW Payload | |
</pre> | |
<pre> | |
<xmp><details> | |
${code$(metadata, 'json')} | |
</details></xmp></pre>`; | |
const newWindow = window.open("", '_blank'); | |
newWindow.document.write(template); | |
})(); | |
// Codeblock parser | |
const code$ = (raw, format = '') => `\`\`\`${format} | |
${format === 'json' ? JSON.stringify(raw, null, 2) : raw} | |
\`\`\` | |
` | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment