尝试使用playwright测试Chrome Extensions时,无法加载扩展名和清单文件不读取
我正在尝试使用剧作家为铬添加铬延长。使用 playwright docs 出于相当小的修正案而言。
path_to_extension = "/Users/name/projects/test_me/src/my_extensions/mm.crx"
user_data_dir = "/tmp/test-user-data-dir"
def run(playwright):
context = playwright.chromium.launch_persistent_context(
user_data_dir,
headless=False,
args=[
f"--disable-extensions-except={path_to_extension}",
f"--load-extension={path_to_extension}",
],
)
background_page = context.background_pages[0]
context.close()
我收到:
无法从:/users/name/projects/test_me/src/my_extensions/mm.m.crx加载扩展。清单文件缺少或不可读
我确定扩展名与扩展名称本身的路径本身正确,这是几次。另外,我尝试了不同的选项来提供路径:如示例中的硬编码;使用OS模块;但是,改变路径仍然存在。
此外,我尝试使用不同的解决方案下载.crx文件,这也无济于事。
非常感谢任何建议:)
I am trying to add a Chrome extension to Chromium using Playwright. Use Playwright docs for that purpose with pretty small amendments.
path_to_extension = "/Users/name/projects/test_me/src/my_extensions/mm.crx"
user_data_dir = "/tmp/test-user-data-dir"
def run(playwright):
context = playwright.chromium.launch_persistent_context(
user_data_dir,
headless=False,
args=[
f"--disable-extensions-except={path_to_extension}",
f"--load-extension={path_to_extension}",
],
)
background_page = context.background_pages[0]
context.close()
I receive:
Failed to load extension from: /Users/name/projects/test_me/src/my_extensions/mm.crx. Manifest file is missing or unreadable
I am sure that the path to the extension along with extension name itself are correct, checked these few times. Also, I tried different options to provide the path: hardcoded as in the example; using os module; changing path, however, still there.
Additionally, I tried to download .crx file using different solutions, that didn't help as well.
Would highly appreciate any suggestions :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论