Closed JamesBotterill closed 4 years ago
There is a message to start recording in content_script.js of the chrome extension. https://github.com/muralikg/puppetcam/blob/df12a68c51e1480cd32def6d841f123edbb8adfa/content_script.js#L22
Remove that from the plugin, which is posting the message on window.load
and do it when your page is ready for recording.
@JamesBotterill Feel free to reopen the issue if you have any issues
@muralikg I've been trying this approach but so far been unable for it to work.
do I need to pass it through using a puppeteer api call?
Yes, it should be from within page.evaluate API
await page.evaluate(function(){
window.postMessage({ type: 'REC_CLIENT_PLAY', data: { url: window.location.origin } }, '*')
})
this is the same issue as I was running into before, it looks like when you evaluate from within the page the share a tab dialog appears and as such the promise is never resolved and the app sticks.
Trying to find a chromium flag to disable this dialog if possible.
When you start recording the document title has to be set to 'puppetcam` to avoid the permission dialog box. Can you try with this.
await page.evaluate(function(){
document.title = 'puppetcam'
window.postMessage({ type: 'REC_CLIENT_PLAY', data: { url: window.location.origin } }, '*')
})
that resolved it, I didn't think I need to reset it as it's called from within the content script.
Thanks,
James
Document title could be overwritten by some other means on that page (probably by other javascript on that page). Anyways glad it worked for you.
I would like to be able to send the record screen event only after I've done a number of actions within my export.js file.
How would I go about this?