mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-24 06:59:52 +01:00
wombat: auto-disable notifications and geolocation queries
This commit is contained in:
parent
b8769c7de0
commit
28dd799516
@ -2264,6 +2264,30 @@ var wombat_internal = function($wbwindow) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//============================================
|
||||||
|
function init_disable_notifications() {
|
||||||
|
if (window.Notification) {
|
||||||
|
window.Notification.requestPermission = function(callback) {
|
||||||
|
if (callback) {
|
||||||
|
callback("denied");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve("denied");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (window.geolocation) {
|
||||||
|
var disabled = function(success, error, options) {
|
||||||
|
if (error) {
|
||||||
|
error({"code": 2, "message": "not available"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.geolocation.getCurrentPosition = disabled;
|
||||||
|
window.geolocation.watchPosition = disabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//============================================
|
//============================================
|
||||||
function get_final_url(prefix, mod, url) {
|
function get_final_url(prefix, mod, url) {
|
||||||
if (mod == undefined) {
|
if (mod == undefined) {
|
||||||
@ -2426,6 +2450,9 @@ var wombat_internal = function($wbwindow) {
|
|||||||
// open
|
// open
|
||||||
init_open_override();
|
init_open_override();
|
||||||
|
|
||||||
|
// disable notifications
|
||||||
|
init_disable_notifications();
|
||||||
|
|
||||||
// expose functions
|
// expose functions
|
||||||
this.extract_orig = extract_orig;
|
this.extract_orig = extract_orig;
|
||||||
this.rewrite_url = rewrite_url;
|
this.rewrite_url = rewrite_url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user