Here is my source code to test.
// ==UserScript==
// @name MyScript
// @namespace MyNameSpance
// @include /https?://(www.)?facebook.com(/.*)?/
// @require http://code.jquery.com/jquery-2.1.0.min.js
// @version 0.0.0
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function () {
// Don't run on frames or iframes
if (window.top != window.self) {
return ;
}
window.addEventListener('load', function () {
var element = $('.fbNubGroup.clearfix.videoCallEnabled');
console.log(element); // is displayed on the console
var children = element.children();
console.log(children); // is displayed on the console
for (var i = 0; i < children.length; i++) {
var child = $(children[i]);
console.log(child); // is displayed on the console
/*
child :
Object [div.someClasses]
+ 0: div.someClasses
+ __FB_TOKEN: [ 267 ]
*/
console.log(child[0]); // is displayed on the console
console.log(child[0].__FB_TOKEN); // UNDEFINED <-- Firefox only,
Chrome works
var key = child[0].__FB_TOKEN[0];
console.log(key); // not displayed
}
}, false);
}) ();
You can check this on facebook homepage. If you change `@grant` to `none`,
`console.log(key);` works well.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.