将Marionette作为扩展程序安装在FxOS设备上
项目描述
marionette-extension
此存储库包含Marionette的gecko扩展形式,旨在与FxOS设备一起使用。它包含一个安装脚本,您可以使用它,前提是您的手机通过ADB连接
source install_marionette_extension.sh VERSION
WHERE版本是支持的版本号,以下是其中之一:1.3,1.4,2.0,2.1,2.2或2.5。
如果您需要安装adb,请参阅https://mdn.org.cn/en-US/Firefox_OS/Debugging/Installing_ADB
目前支持从FirefoxOS v1.3到v2.5。
Python包
这也是“marionette_extension”Python包。一旦安装此包,您将能够访问名为install_marionette的命令行程序,您可以使用它如下
marionette_extension --help
这将向您展示您可用的安装选项。
如果您需要一个示例,这是如何在v1.3设备上安装Marionette的方法
marionette_extension --install 1.3
您还可以将marionette_extension包导入到Python脚本中,并使用其安装功能通过脚本安装Marionette。示例
from marionette_extension import install
install(FXOS_VERSION, adb=ADBPATH) # Replace FXOS_VERSION with a supported version, and you may use ADBPATH to specify your adb path. If not specified, it will assume 'adb' is on the $PATH
如何添加新版本?
创建一个新的文件夹,指明您的新的Gecko版本
hg clone https://hg.mozilla.org/mozilla-central/
从现在开始,请参考之前marionette-extension版本的文件和文件夹结构
转到mozilla-central文件夹,找到/testing/specialpowers(mozilla-central)并将它们复制到special-powers@mozilla.org文件夹
将/testing/marionette(mozilla-central)中的所有.js文件复制到marionette@mozilla.org/chrome/content
将chrome.manifest和install.rdf从之前版本的marionette-extension复制到marionette@mozilla.org文件夹
将testing/marionette/components/marionettecomponent.js(mozilla-central)复制到/marionette@mozilla.org/components并将它重命名为marionetteextensioncomponent.js
对marionetteextensioncomponent.js执行以下操作
将MARIONETTE_CONTRACTID值替换为“@mozilla.org/marionetteextension;1”
将profile-after-change监听器更改为始终启动Marionette,而不是依赖于构建标志或命令行
this.enabled = true; this.logger.info("marionette enabled via extension"); // We want to suppress the modal dialog that's shown // when starting up in safe-mode to enable testing. if (Services.appinfo.inSafeMode) { this.observerService.addObserver(this, "domwindowopened", false); }
将组件名称从MarionetteComponent更改为MarionetteExtensionComponent
请求将其放在pypi上以实现更快的安装
项目详情
marionette_extension-0.4.9.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 2d111b91f22f336fa96d0f324790c6a82759858376d31b69874f83a67904e107 |
|
MD5 | 4b57fa5fbf32c2029d856a9b1fb6b111 |
|
BLAKE2b-256 | 0a2ca1b65453ba93c2298e23491e3e764c1bf92055ffbd3848a105bb9e9f9e94 |