avoid chrome popup extension to close

后端 未结 5 1546
死守一世寂寞
死守一世寂寞 2020-12-30 05:26

Is there a function that allow me to select text when the extension stays open. Normally when I Use the extension popup and I Click outside the extension the extension close

5条回答
  •  没有蜡笔的小新
    2020-12-30 05:55

    I encountered the same problem and I've thought of a possible solution (though not tested it):

    Use your background.html to store the content of the popup action and upon loading the popup, you fetch the content via the default messaging for chrome extensions.

    When doing all kinds of other stuff, like XHR's or something, I think you should do that in background.html too, so the requests won't abort if you close and you can do something with the result. Then when a user re-opens the popup, he'll see the result of his previous action instead of the default screen.

    Anyone tried something like did already?

提交回复
热议问题