Created
September 13, 2016 17:20
-
-
Save anonymous/7732ca92b8a1653661b74fa833a66c0e to your computer and use it in GitHub Desktop.
Location Fix for CurrentConditions
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
// ==UserScript== | |
// @name Location Fix for CurrentConditions | |
// @version 0.1 | |
// @description Override getCurrentPosition() to work around the fact that it's disabled for insecure origins | |
// @match http://currentcondition.org/ | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Change these to whatever you want: | |
var LATITUDE = 36.9; | |
var LONGITUDE = -100.3; | |
navigator.geolocation.getCurrentPosition = function (callback) { callback({coords: {latitude: LATITUDE, longitude: LONGITUDE}}); }; | |
console.log("Location fix enabled"); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment