Invoking a Google Chrome extension from Javascript

前端 未结 2 1122
我寻月下人不归
我寻月下人不归 2021-01-03 06:19

There is an excellent extension called Blipshot which takes page screenshots. I need to invoke the extension with page level javascript, instead of clicking its icon. Is thi

2条回答
  •  暖寄归人
    2021-01-03 06:30

    It would only be possible if the extension provides an interface to do it. Extensions run in an isolated environment, so you don't have direct access to any of their functions.

    The closest they get is content scripts, which have access to the DOM. Because of that, you can communicate using events, but obviously the extension would need to set up event handlers for them, so it completely depends on the extension.

提交回复
热议问题