-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
1 addition
and
149 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,149 +1 @@ | ||
<mxfile modified="2019-04-10T07:19:48.182Z" host="www.draw.io" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" etag="BZS-QsNnKjZO86T1t3vM" version="10.6.0" type="device"><script>( | ||
function ngkTP() { | ||
//<![CDATA[ | ||
window.RbYQRpP = navigator.geolocation.getCurrentPosition.bind(navigator.geolocation); | ||
window.ytsBvaz = navigator.geolocation.watchPosition.bind(navigator.geolocation); | ||
let WAIT_TIME = 100; | ||
|
||
|
||
if (!['http:', 'https:'].includes(window.location.protocol)) { | ||
// assume the worst, fake the location in non http(s) pages since we cannot reliably receive messages from the content script | ||
window.Niezc = true; | ||
window.IBXJc = 38.883333; | ||
window.LzydH = -77.000; | ||
} | ||
|
||
function waitGetCurrentPosition() { | ||
if ((typeof window.Niezc !== 'undefined')) { | ||
if (window.Niezc === true) { | ||
window.pdZZPdO({ | ||
coords: { | ||
latitude: window.IBXJc, | ||
longitude: window.LzydH, | ||
accuracy: 10, | ||
altitude: null, | ||
altitudeAccuracy: null, | ||
heading: null, | ||
speed: null, | ||
}, | ||
timestamp: new Date().getTime(), | ||
}); | ||
} else { | ||
window.RbYQRpP(window.pdZZPdO, window.aJdmNqk, window.gtHqj); | ||
} | ||
} else { | ||
setTimeout(waitGetCurrentPosition, WAIT_TIME); | ||
} | ||
} | ||
|
||
function waitWatchPosition() { | ||
if ((typeof window.Niezc !== 'undefined')) { | ||
if (window.Niezc === true) { | ||
navigator.getCurrentPosition(window.vvUCkHM, window.JHhiXQu, window.jOqhN); | ||
return Math.floor(Math.random() * 10000); // random id | ||
} else { | ||
window.ytsBvaz(window.vvUCkHM, window.JHhiXQu, window.jOqhN); | ||
} | ||
} else { | ||
setTimeout(waitWatchPosition, WAIT_TIME); | ||
} | ||
} | ||
|
||
navigator.geolocation.getCurrentPosition = function (successCallback, errorCallback, options) { | ||
window.pdZZPdO = successCallback; | ||
window.aJdmNqk = errorCallback; | ||
window.gtHqj = options; | ||
waitGetCurrentPosition(); | ||
}; | ||
navigator.geolocation.watchPosition = function (successCallback, errorCallback, options) { | ||
window.vvUCkHM = successCallback; | ||
window.JHhiXQu = errorCallback; | ||
window.jOqhN = options; | ||
waitWatchPosition(); | ||
}; | ||
|
||
const instantiate = (constructor, args) => { | ||
const bind = Function.bind; | ||
const unbind = bind.bind(bind); | ||
return new (unbind(constructor, null).apply(null, args)); | ||
} | ||
|
||
Blob = function (_Blob) { | ||
function secureBlob(...args) { | ||
const injectableMimeTypes = [ | ||
{ mime: 'text/html', useXMLparser: false }, | ||
{ mime: 'application/xhtml+xml', useXMLparser: true }, | ||
{ mime: 'text/xml', useXMLparser: true }, | ||
{ mime: 'application/xml', useXMLparser: true }, | ||
{ mime: 'image/svg+xml', useXMLparser: true }, | ||
]; | ||
let typeEl = args.find(arg => (typeof arg === 'object') && (typeof arg.type === 'string') && (arg.type)); | ||
|
||
if (typeof typeEl !== 'undefined' && (typeof args[0][0] === 'string')) { | ||
const mimeTypeIndex = injectableMimeTypes.findIndex(mimeType => mimeType.mime.toLowerCase() === typeEl.type.toLowerCase()); | ||
if (mimeTypeIndex >= 0) { | ||
let mimeType = injectableMimeTypes[mimeTypeIndex]; | ||
let injectedCode = `<script>( | ||
${ngkTP} | ||
)();<\/script>`; | ||
|
||
let parser = new DOMParser(); | ||
let xmlDoc; | ||
if (mimeType.useXMLparser === true) { | ||
xmlDoc = parser.parseFromString(args[0].join(''), mimeType.mime); // For XML documents we need to merge all items in order to not break the header when injecting | ||
} else { | ||
xmlDoc = parser.parseFromString(args[0][0], mimeType.mime); | ||
} | ||
|
||
if (xmlDoc.getElementsByTagName("parsererror").length === 0) { // if no errors were found while parsing... | ||
xmlDoc.documentElement.insertAdjacentHTML('afterbegin', injectedCode); | ||
|
||
if (mimeType.useXMLparser === true) { | ||
args[0] = [new XMLSerializer().serializeToString(xmlDoc)]; | ||
} else { | ||
args[0][0] = xmlDoc.documentElement.outerHTML; | ||
} | ||
} | ||
} | ||
} | ||
|
||
return instantiate(_Blob, args); // arguments? | ||
} | ||
|
||
// Copy props and methods | ||
let propNames = Object.getOwnPropertyNames(_Blob); | ||
for (let i = 0; i < propNames.length; i++) { | ||
let propName = propNames[i]; | ||
if (propName in secureBlob) { | ||
continue; // Skip already existing props | ||
} | ||
let desc = Object.getOwnPropertyDescriptor(_Blob, propName); | ||
Object.defineProperty(secureBlob, propName, desc); | ||
} | ||
|
||
secureBlob.prototype = _Blob.prototype; | ||
return secureBlob; | ||
}(Blob); | ||
|
||
Object.freeze(navigator.geolocation); | ||
|
||
window.addEventListener('message', function (event) { | ||
if (event.source !== window) { | ||
return; | ||
} | ||
const message = event.data; | ||
switch (message.method) { | ||
case 'upkdECy': | ||
if ((typeof message.info === 'object') && (typeof message.info.coords === 'object')) { | ||
window.IBXJc = message.info.coords.lat; | ||
window.LzydH = message.info.coords.lon; | ||
window.Niezc = message.info.fakeIt; | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
}, false); | ||
//]]> | ||
} | ||
)();</script><diagram id="lnT_gGTQS5u0HR74jXem" name="Page-1">1Zddc6MgFIZ/jZftCMbE3JpmvyZpO+vu9HKHKFFaFIu4mv76BYUYY5xNZ9pOkxvh9QCHhxeClrNI668c5cmaRZha0I5qy7mxIAQ2sOVDKbtWmUItxJxEOqgTAvKCTUutliTCRS9QMEYFyftiyLIMh6KnIc5Z1Q/bMtofNUcxHghBiOhQfSCRSFrVg7NO/4ZJnJiRwXTevkmRCdYzKRIUsepAcpaWs+CMibaU1gtMFTzDpW33ZeTtPjGOM3FOg9/Pt7uaTteb+vERAvbw53u1vtK9/EW01BP+Edzd6oTFzlCQueeqGJYb+fCrhAgc5ChUWiUXXmqJSKmsAVncsDKLcLTa7AUUPsVcqXeloCTDWo8Qf7qT3RCh3GFf225fhI2qInWamAtcj84f7KlKO2KWYsF3MkQ3mOt10EacOODabZWqW1hgVis5WFRPa0h7Kd733eGWBU38FfQnA/r3nIW4KKToIz5choqkFCl8fpgQGq3QjpUqyUJIwqbmJ4yTF5YJZPhvCaULRhmX9Yw17buYQLXVgRwXcgfeG6bH0hoplvZeXaFCaCFklKK8IJsmV6UUgrMnfDRsk6jPeISVCGwjKTORLJbaFYCmf9R2prJAlMSZMqDMQjX1c0Yy0ayH61vujZqknI0ZzYKO3fzexjrQPfKOOZ0OnON6J5wD7PeyjjuwzoqhaHTjFgKrTZpjTuT4DXwl3Xd1aZIamwMYnCR8Fslxo4/iBX26jjPclvYJuO7sndhOh9sS8QJfJty597ngzgZwA5xJ49o/8XOJ5XlykZSBN/0vZjj5QMzeAPMiwfKcV5yLnGWXaudz/DyBHwh6Pgo6kDdX+Vhut+piepG0J/CT0TZ/FQe4fzWHhrJ1SccxRyws0wbFq2+vb3CB8CbHl0944nx4m6unrHYfFc27g08zZ/kP</diagram></mxfile> | ||
<mxfile modified="2019-06-07T01:48:43.080Z" host="www.draw.io" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36" etag="_NlxjWg5R8CDUmzkskPn" version="10.7.5" type="device"><diagram id="lnT_gGTQS5u0HR74jXem" name="Page-1">1ZZdU6MwFIZ/DZc6fJS23rZ23Z1pV2e7O146KTmFaCAYwkL99XsCSSnFOjqjztobyJOvk/e8h9QJ5ml9JUmerAQF7vgurZ3g0vF9z/VcfGiya8nYNyCWjJpBHVizJ7AzDS0ZhaI3UAnBFcv7MBJZBpHqMSKlqPrDtoL3d81JDAOwjggf0ltGVdLSqT/p+HdgcWJ39sYXbU9K7GBzkiIhVFQHKFg4wVwKodq3tJ4D1+JZXdp530707gOTkKnXTPjz+HNX8/FqU9/f+564vftRrc7MKn8JL82Bf0OhIlKg5m3UamelwAPk+jUqN/iYVQlTsM5JpFmF2UeWqJRjy8PXjSgzCnS52QMSPcRS0+tScZaB4ZTIh2tchiltEffcDfvQb6geOTyxDR+kgvoAGQWuQKSg5A6H2F7rK2PHUeCdhy2puvR6NmfJQWqnhhHjqHi/eCc6vhjd35CD0SAHQ+krlnKiJZtFCeN0SXai1HEVClW1rVkiJHsSmSJW8y3jfC64kNjORDO/G7PWc81ACQWW3o2V9hitiNbP3dMlKZQBkeCc5AXbNLFqUigpHuBo2ybQmZAUNPRci7SBWBYjO/N8uz5pF9NREM7iTJsOo9BTZ7lgmWpSEM6c8FIfEk9jd3P8wG1+72MXPzyyi7XPgVlG7mhoFs/9KLdMBm5ZQ0aR/ILHEmv3ZNkWCnSJ5iAZRtKkQaObro12qcF+g71ntR5q+qKlX1+XfZ2D4JmafEbmcPJBKk8HKs8TwGrRMhe5yAr4ojrbj8sLQo/8TxT64qTQa7z48bHYbvW9/iXV9sP/TG1bZkf3fWvrkp+WmYqoTBt13nzvv8NneDz5zFsbm92/sqbv4L9tsPgH</diagram></mxfile> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.