Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Last active January 3, 2023 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/a282830d16be7d5b0f84e445572b3913 to your computer and use it in GitHub Desktop.
Save kballenegger/a282830d16be7d5b0f84e445572b3913 to your computer and use it in GitHub Desktop.
Force Google Flights to use USD
// ==UserScript==
// @name Google Flights Default USD
// @version 0.1
// @description Force Google Flights to use USD
// @author Kenneth Ballenegger
// @match https://www.google.com/flights/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kswizz.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Get the current URL and parse it
const currentUrl = new URL(window.location.href);
// Check if the `curr` URL parameter is present
if (!currentUrl.searchParams.has('curr')) {
// If not, add it to the URL
currentUrl.searchParams.set('curr', 'USD');
// Replace the current URL with the updated one
window.history.replaceState(null, null, currentUrl.toString());
location.reload();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment