Coder Social home page Coder Social logo

如何远程执行录制命令 about rebirth HOT 7 CLOSED

runc avatar runc commented on July 20, 2024
如何远程执行录制命令

from rebirth.

Comments (7)

runc avatar runc commented on July 20, 2024

否则还是无法真正的自动化,毕竟执行命令部分需要手工执行。

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 20, 2024

你指的的console控制台是指在要录制的网站中执行一些javascript命令么?

from rebirth.

runc avatar runc commented on July 20, 2024

你指的的console控制台是指在要录制的网站中执行一些javascript命令么?

比如我要远程,比如通过api来执行以下命令
rebirth.init();
rebirth.start();
rebirth.pause();
rebirth.resume();

这样我就可以自动录制某个网页,而现在是人肉在console上执行这些命令,无法自动化。

from rebirth.

runc avatar runc commented on July 20, 2024

你指的的console控制台是指在要录制的网站中执行一些javascript命令么?

给你gmail邮件了,方便的话,加个好友进一步交流下。

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 20, 2024

一般来说,这个项目是录制”可控“的网站,因为要录制的网站可控,所以可以通过在网站里添加:

rebirth.init();
rebirth.start();
rebirth.pause();
rebirth.resume();

来调用录制的api

如果想要录制非可控的网站,需要在: https://github.com/alo7/rebirth/blob/master/src/chrome-extension/injected.ts
此文件下面添加你的代码,并重新构建。因为 injected 文件中的代码将会被注入到打开的网站里。

from rebirth.

subdance avatar subdance commented on July 20, 2024

需要在: https://github.com/alo7/rebirth/blob/master/src/chrome-extension/injected.ts
此文件下面添加你的代码,并重新构建。

请问一下,这里的chrome-extension 构建出dist应该如何操作?

from rebirth.

BlackHole1 avatar BlackHole1 commented on July 20, 2024

@subdance
只需要构建完成,直接使用就可,因为 node 中再打开chrome 的时候,代码为:

`--load-extension=${EXTENSIONS_DIR}`,
`--disable-extensions-except=${EXTENSIONS_DIR}`,

代码详情见: https://github.com/alo7/rebirth/blob/master/src/lib/startChrome.js#L16-L17

EXTENSIONS_DIR 为:

const EXTENSIONS_DIR = isDocker() ? path.join(PROJECT_DIR, 'extensions_dist') : path.join(PROJECT_DIR, 'src', 'extensions_dist');

代码详情见: https://github.com/alo7/rebirth/blob/master/src/lib/constants.js#L10

所以在启动 chrome 的时候,其实是直接使用 dist 目录下的代码

from rebirth.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.