Browse Source

Remove language specific attribute lookup. Fixes #58

aria-label is language dependant so this selector only worked in english, now we find a known link that is at depth 1 in the target div, get the parentNode and set a unique attribute to fetch in the selector.
pull/61/head
Samuel Attard 7 years ago
parent
commit
0c36ee083f
  1. 5
      Google Play Music/Resources/custom-interface.js

5
Google Play Music/Resources/custom-interface.js

@ -57,7 +57,8 @@ var check = setInterval(function () {
hideDiv(document.querySelectorAll('.nav-item-container[data-action=upload-music]')[0]);
hideDiv(document.querySelectorAll('.nav-item-container[data-action=help-and-feedback]')[0]);
var divs = document.querySelectorAll('[aria-label="Account Information"] > div');
document.querySelectorAll('[href="https://plus.google.com/u/0/dashboard"]')[0].parentNode.setAttribute('data-gpmdp-account-node', 'true');
var divs = document.querySelectorAll('[data-gpmdp-account-node="true"] > div');
hideDiv(divs[0]);
hideDiv(divs[1]);
hideDiv(divs[2].querySelectorAll('div')[0]);
@ -89,4 +90,4 @@ var check = setInterval(function () {
});
document.querySelectorAll('.nav-section.material')[0].insertBefore(d_settings, document.querySelectorAll('.nav-section.material > a')[2])
}
}, 10);
}, 10);

Loading…
Cancel
Save