0

when i transfer objects or functions from the backgroundPage to my contentscript they become unusable (i can't call the function because they are not seen as functions), but ordinary string values work. Is there something i am missing. Thanks

1 Answer 1

1

You can't do that, the message is serialized before transmitting. See https://developer.mozilla.org/en/DOM/The_structured_clone_algorithm . Specifically:

Error and Function objects cannot be duplicated by the structured clone algorithm; attempting to do so will throw a DATA_CLONE_ERR exception.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.