- From: Vova Levchenko via GitHub <sysbot+gh@w3.org>
- Date: Sun, 12 Feb 2023 23:10:20 +0000
- To: public-webrtc@w3.org
wlevchenko has just created a new issue for https://github.com/w3c/mediacapture-region:
== [QUESTION] How to pass CropTarget to chrome extension service worker? ==
I am trying to receive cropTarget from the content script in the service worker.
`
async function getCropTarget () {
const element = document.getElementById('crop-area')
const cropTarget = await window.CropTarget.fromElement(element)
return cropTarget
}
(async () => {
const tabId = await getTabId()
if (tabId != null) {
chrome.scripting
.executeScript({
target: { tabId },
func: getCropTarget
})
.then(injectionResults => {
console.log(injectionResults)
})
}
})()
`
But I just received a blank object.

Do I have any chance to do this?
Please view or discuss this issue at https://github.com/w3c/mediacapture-region/issues/75 using your GitHub account
--
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 12 February 2023 23:10:21 UTC