MCPcopy Create free account
hub / github.com/Threezh1/Deconstruct / getMainHost

Function getMainHost

DevTools_JSFinder/JSFinder.js:39–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 console.log("JSFinder get domains: ", Array.from(new Set(domains)));
38 console.log("JSFinder get urls: ", Array.from(new Set(result)));
39 function getMainHost() {
40 let key = `mh_${Math.random()}`;
41 let keyR = new RegExp( `(^|;)\\s*${key}=12345` );
42 let expiredTime = new Date( 0 );
43 let domain = document.domain;
44 let domainList = domain.split( '.' );
45 let urlItems = [];
46 urlItems.unshift( domainList.pop() );
47 while( domainList.length ) {
48 urlItems.unshift( domainList.pop() );
49 let mainHost = urlItems.join( '.' );
50 let cookie = `${key}=${12345};domain=.${mainHost}`;
51 document.cookie = cookie;
52 if ( keyR.test( document.cookie ) ) {
53 document.cookie = `${cookie};expires=${expiredTime}`;
54 return mainHost;
55 }}}
56 function geturlContent(pathname){
57 var result = ""
58 var request = new XMLHttpRequest();

Callers 2

JSFinder.jsFile · 0.85
extract_urlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected