Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Bookmarklet.js #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

OmPrakash95
Copy link

Way of fetching User's ID is changed since No JSON Object 'Env' was available

Way of fetching User's ID is changed since No JSON Object 'Env' was available
@karmiphuc
Copy link

+1

Really expecting this fix.

I had a workaround on this, but your solution is better.

var uidDom = document.querySelector('a[data-testid]')||(document.getElementById('userNav')).childNodes[0].childNodes[0].childNodes[0];

var uidDomJson = uidDom.getAttribute('data-gt');
if (!(typeof uidDomJson != 'undefined' && uidDomJson)) {
    alert('Your browser is not supported! Please contact the author.');
}

var uidData = JSON.parse(uidDomJson);
var uid = uidData.bmid;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants