How do I make it so my Chrome extension will only inject a script once?

前端 未结 2 714
故里飘歌
故里飘歌 2021-01-13 19:17

I\'m using programmatic injection to inject my extension\'s code into a page only when the browser action is clicked.

This is what I have on my extension\'s event pa

2条回答
  •  迷失自我
    2021-01-13 19:48

    Put a gloabl variable in your contentscript to judge if the contentscript has executed.

    if (something) { return; }
    

提交回复
热议问题