// ==UserScript==
// @name Netflix Plans Fetcher
// @description Get Netflix prices of all countries
// @author /u/Wilcooo
// @include https://www.netflix.com/*
// @grant GM_getValue
// @grant GM_setValue
// @run-at document-start
// @version 1
// @namespace /u/Wilcooo
// @downloadURL https://update.greasyfork.icu/scripts/372116/Netflix%20Plans%20Fetcher.user.js
// @updateURL https://update.greasyfork.icu/scripts/372116/Netflix%20Plans%20Fetcher.meta.js
// ==/UserScript==
var data = GM_getValue('data',{});
if (location.pathname.startsWith('/signup')) {
// Getting the prices & current country whenever the Netflix site is opened
document.addEventListener("DOMContentLoaded", function(event) {
var geo = netflix.reactContext.models.signupContext.data.geo.requestCountry,
options = netflix.reactContext.models.signupContext.data.flow.fields.planChoice.options;
data[geo.id] = {geo:geo, options:options};
GM_setValue('data',data);
// Get the exchange rates (used later)
var exchange_rates = jQuery.getJSON("https://www.floatrates.com/daily/usd.json");
// Write the result info:
document.body.innerHTML =
'Done! You can select another country now.
' +
'You can disable this userscript in your userscript manager (f.e. Tampermonkey). You can usually find its icon in the top right.
' +
'This is all collected data so far, you can copypasta this table right into EXCEL
' +
'Click here to remove everything.
'+
'For more details, type NPFdata in the JS console.
';
// Create the table:
var table = document.createElement('table');
document.body.appendChild(table);
table.innerHTML = "