This project records the web page in the server.
Chrome DevTools Protocol and VNC debuggingdocker run -dit -P --name rebirth_alo7 -v `pwd`/rebirth_alo7/logs:/etc/www/logs -v `pwd`/rebirth_alo7/video:/root/Downloads -e MATERIAL_URL="https://www.alo7.com/en/" -e START_VNC="yes" alo7docker/rebirth
After the webpage is loaded, some api will be injected for the webpage to use.
// Initialize the API (if not called within 5 minutes, the task is considered to have failed) to ensure that the web page can be opened normally.
rebirth.init();
// start record
rebirth.start();
// pause record
rebirth.pause();
// resume record
rebirth.resume();
// stop record
rebirth.stop('filename');
// record fail
rebirth.fail();
// set extra info, The final information is delivered to your custom code
rebirth.setExtraInfo({
foo: 'bar'
});
They are defined in Dockerfile
MATERIAL_URL: The url to be recorded, the default value is https://github.com/START_VNC: Whether to start VNC, open as yes. The default value is noVNC_PASSWORD: VNC connection password, default value is rebirthMAX_RECORD_TIME: What is the maximum time of the current recording, in milliseconds, the default value is 7200000 (two hours)In the src/hooks directory, create a new file: index.js, in the following format:
module.exports = {
/**
* Triggered when recording is complete
*
* @param {Object} data - Client request body
* @return {void | string | Object | number | boolean | Function | Promise.resolve}
*/
completeRecordAfter: (data) => {
console.log(data);
return true;
},
// Triggered after recording failure
// The parameters are the same as completeRecordAfter
failAfter: () => {},
};
Thanks goes to these wonderful people:
Content type
Image
Digest
Size
386.5 MB
Last updated
over 6 years ago
docker pull alo7docker/rebirth