Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2016 17:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7732ca92b8a1653661b74fa833a66c0e to your computer and use it in GitHub Desktop.
Save anonymous/7732ca92b8a1653661b74fa833a66c0e to your computer and use it in GitHub Desktop.
Location Fix for CurrentConditions
// ==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