// ==UserScript== // @name Qobuz Country Switcher // @namespace https://greasyfork.org/en/scripts/21760-qobuz-country-switcher // @version 1.0 // @description Relocates the country selector menu to just above the album list or just below the cover artwork, and remaps the menu URLs from their countries' homepages to the current page's equivalent page in each country/language. // @author newstarshipsmell // @include /https?://(www.)?qobuz\.com/[a-z]{2}-[a-z]{2}/(album|interpreter|label|genre)/.+/ // @grant GM_addStyle // @downloadURL https://update.greasyfork.icu/scripts/21760/Qobuz%20Country%20Switcher.user.js // @updateURL https://update.greasyfork.icu/scripts/21760/Qobuz%20Country%20Switcher.meta.js // ==/UserScript== //function GM_addStyle(' !important'); var pagePath = window.location.pathname.replace(/^\/[a-z]{2}-[a-z]{2}\//, ''); var countryMenu = document.querySelector('#country-shop'); storeLinks = countryMenu.getElementsByTagName('a'); for (var i = 1, len = storeLinks.length; i < len; i++) storeLinks[i].href = storeLinks[i].href + pagePath; var newPosition = document.querySelector(/^album\//.test(pagePath) ? '.action' : '#search-tree'); //var newPosition = document.querySelector(/^album\//.test(pagePath) ? '#item' : '.page-header'); newPosition.parentNode.insertBefore(countryMenu,newPosition); /* If the GM_addStyle line is enabled with the necessary custom CSS added to override the site CSS that styles the dropdown menu to open upwards, then remove the first var newPosition line and remove the // from the line below it, and the dropdown menu should insert itself below the breadcrumb (the "You are here:" row.) CSS URL: http://www.qobuz.com/minify/g=a8c31b2815754fcffe71e0d766285022.css Country dropdown element page source:
*/