Open sticks-stuff opened 2 years ago
Object.entries()
, Object.keys()
, Object.values()
of DOM elements are only available in page
context and not in contentScripts
context.
page
context by defaultpage
context when there is no @grant
contentScripts
However, in Firefox you can get them using wrappedJSObject
.
See also: https://github.com/erosman/support/issues/429#issuecomment-1445417280 https://github.com/erosman/support/issues/429#issuecomment-1445448982 https://github.com/erosman/support/issues/429#issuecomment-1456931722
Running
Object.entries(document.querySelector("main[role='main'] section[role='region']").parentElement.parentElement)
on any tweet returns an array of seven items, but returns nothing when running through a userscript like above.It should be noted that this userscript works perfectly on TamperMonkey on Chrome