Last active
January 3, 2023 05:20
-
-
Save kballenegger/a282830d16be7d5b0f84e445572b3913 to your computer and use it in GitHub Desktop.
Force Google Flights to use USD
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
// ==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