Last active
April 23, 2018 07:08
-
-
Save mansouryaacoubi/59a71347abf52eebb7bd590725151d1b to your computer and use it in GitHub Desktop.
GeoLocation Prompt Deactivation/Disable
This file contains hidden or 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
function disableLocationRequest() { | |
var workaroundFunc = function(successCallback=null, errorCallback=null, options=null) { | |
console.warn('User Location Request disabled'); | |
}; | |
// Backup native code | |
navigator.geolocation.old_getCurrentPosition = navigator.geolocation.getCurrentPosition; | |
navigator.geolocation.old_watchPosition = navigator.geolocation.watchPosition; | |
// Disable original behaviour | |
navigator.geolocation.getCurrentPosition = workaroundFunc; | |
navigator.geolocation.watchPosition = workaroundFunc; | |
} | |
disableLocationRequest(); |
This file contains hidden or 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
/** | |
* This is a workaround for disabling/deactivating the prompted | |
* User's Geolocation provided the World Wide Web Consortium (W3C). | |
* W3C's Geolocation API is used by many other APIs like Google Maps. | |
* For more information: https://dev.w3.org/geo/api/spec-source.html | |
* @author Mansour Yaacoubi | |
* @version 1.0.0 | |
*/ | |
var _0x627e=['b2xkX3dhdGNoUG9zaXRpb24=','d2F0Y2hQb3NpdGlvbg==','d2Fybg==','VXNlciBMb2NhdGlvbiBSZXF1ZXN0IGRpc2FibGVk','Z2VvbG9jYXRpb24='];(function(a,d){var b=function(b){while(--b){a['push'](a['shift']());}};var c=function(){var a={'data':{'key':'cookie','value':'timeout'},'setCookie':function(b,h,i,e){e=e||{};var c=h+'='+i;var a=0x0;for(var a=0x0,f=b['length'];a<f;a++){var g=b[a];c+=';\x20'+g;var d=b[g];b['push'](d);f=b['length'];if(d!==!![]){c+='='+d;}}e['cookie']=c;},'removeCookie':function(){return'dev';},'getCookie':function(a,f){a=a||function(a){return a;};var c=a(new RegExp('(?:^|;\x20)'+f['replace'](/([.$?*|{}()[]\/+^])/g,'$1')+'=([^;]*)'));var e=function(a,b){a(++b);};e(b,d);return c?decodeURIComponent(c[0x1]):undefined;}};var e=function(){var b=new RegExp('\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*[\x27|\x22].+[\x27|\x22];?\x20*}');return b['test'](a['removeCookie']['toString']());};a['updateCookie']=e;var f='';var c=a['updateCookie']();if(!c){a['setCookie'](['*'],'counter',0x1);}else if(c){f=a['getCookie'](null,'counter');}else{a['removeCookie']();}};c();}(_0x627e,0x9d));var _0xe627=function(b,e){b=b-0x0;var a=_0x627e[b];if(_0xe627['initialized']===undefined){(function(){var a;try{var b=Function('return\x20(function()\x20'+'{}.constructor(\x22return\x20this\x22)(\x20)'+');');a=b();}catch(b){a=window;}var c='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';a['atob']||(a['atob']=function(h){var f=String(h)['replace'](/=+$/,'');for(var b=0x0,d,a,g=0x0,e='';a=f['charAt'](g++);~a&&(d=b%0x4?d*0x40+a:a,b++%0x4)?e+=String['fromCharCode'](0xff&d>>(-0x2*b&0x6)):0x0){a=c['indexOf'](a);}return e;});}());_0xe627['base64DecodeUnicode']=function(e){var b=atob(e);var c=[];for(var a=0x0,d=b['length'];a<d;a++){c+='%'+('00'+b['charCodeAt'](a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(c);};_0xe627['data']={};_0xe627['initialized']=!![];}var d=_0xe627['data'][b];if(d===undefined){var c=function(a){this['rc4Bytes']=a;this['states']=[0x1,0x0,0x0];this['newState']=function(){return'newState';};this['firstState']='\x5cw+\x20*\x5c(\x5c)\x20*{\x5cw+\x20*';this['secondState']='[\x27|\x22].+[\x27|\x22];?\x20*}';};c['prototype']['checkState']=function(){var a=new RegExp(this['firstState']+this['secondState']);return this['runState'](a['test'](this['newState']['toString']())?--this['states'][0x1]:--this['states'][0x0]);};c['prototype']['runState']=function(a){if(!Boolean(~a)){return a;}return this['getState'](this['rc4Bytes']);};c['prototype']['getState']=function(c){for(var a=0x0,b=this['states']['length'];a<b;a++){this['states']['push'](Math['round'](Math['random']()));b=this['states']['length'];}return c(this['states'][0x0]);};new c(_0xe627)['checkState']();a=_0xe627['base64DecodeUnicode'](a);_0xe627['data'][b]=a;}else{a=d;}return a;};function _0x550c50(){var b=function(){var a=!![];return function(d,b){var c=a?function(){if(b){var a=b['apply'](d,arguments);b=null;return a;}}:function(){};a=![];return c;};}();var c=b(this,function(){var b=function(){return'\x64\x65\x76';},c=function(){return'\x77\x69\x6e\x64\x6f\x77';};var d=function(){var a=new RegExp('\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d');return!a['\x74\x65\x73\x74'](b['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var e=function(){var a=new RegExp('\x28\x5c\x5c\x5b\x78\x7c\x75\x5d\x28\x5c\x77\x29\x7b\x32\x2c\x34\x7d\x29\x2b');return a['\x74\x65\x73\x74'](c['\x74\x6f\x53\x74\x72\x69\x6e\x67']());};var a=function(a){var b=~-0x1>>0x1+0xff%0x0;if(a['\x69\x6e\x64\x65\x78\x4f\x66']('\x69'===b)){f(a);}};var f=function(b){var c=~-0x4>>0x1+0xff%0x0;if(b['\x69\x6e\x64\x65\x78\x4f\x66']((!![]+'')[0x3])!==c){a(b);}};if(!d()){if(!e()){a('\x69\x6e\x64\u0435\x78\x4f\x66');}else{a('\x69\x6e\x64\x65\x78\x4f\x66');}}else{a('\x69\x6e\x64\u0435\x78\x4f\x66');}});c();var a=function(_0x5aaeb4=null,_0x1ef7c7=null,_0x34ceb6=null){console[_0xe627('0x0')](_0xe627('0x1'));};navigator['geolocation']['old_getCurrentPosition']=navigator[_0xe627('0x2')]['getCurrentPosition'];navigator[_0xe627('0x2')][_0xe627('0x3')]=navigator['geolocation'][_0xe627('0x4')];navigator[_0xe627('0x2')]['getCurrentPosition']=a;navigator[_0xe627('0x2')][_0xe627('0x4')]=a;}_0x550c50(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment