Open Treora opened 6 years ago
Some notes to self (or others who wish to implement this):
The current source code suggests that the grabber function would, given an (i)frame element, give back a DOM; the default is to try read frameElement.contentDocument
(lines). I assumed a grabber function would call some privileged code (a content script inside the frame) to access the iframe's DOM and return that, possibly after having serialised&messaged&parsed it again.
However, the serialising&messaging&parsing would break the living parts, preventing us from then accessing any frames within the frame, as well as canvas data (#18) and form state (#19).
Some possible solutions:
resource
object. It should then run captureDom
to recurse into its own frames, grab canvas data, etc. Downside is that a resource object contains getters like .blob
and .string
, which we could not pass in a message.
As explained in src/Readme: