Why doesn't a console loaded script have access to the DOM?
I added a script to the DOM using
// in the console of facebook.com
var test = document.createElement('script');
test.src = "foo";
document.head.appendChild(test);
but the script has no access to the DOM.
Does this have to do with the same origin policy?
This method appears to not be working as it no longer will "pull" tags.
$P.aDOM = function (name) {
var obj = {},
all_el = document.body.getElementsByTagName("*"),
i,
len,
cur,
style,
temp;
for (i = 0, len = all_el.length; i < len; i++) {
cur = all_el[i];
style = win.getComputedStyle(cur);
temp = style.getPropertyValue(name);
obj[i] = [cur.id, cur.tagName, cur.className, temp];
}
return obj;
};
No comments:
Post a Comment