chrome extension popup not open immediately

后端 未结 2 1733
猫巷女王i
猫巷女王i 2021-01-15 16:47

I\'m writing a chrome extension.

When i click the browser action button in the first time - all goes well.

When i click the browser action button the second

相关标签:
2条回答
  • 2021-01-15 17:12

    i have seen this behavior before when you have a long running ajax call that you are doing on popup load.. hard to tell further without code samples or description of what you are doing

    0 讨论(0)
  • 2021-01-15 17:16

    I had a similar issue with the popup when I was adding an iframe to the popup. Chrome would wait with showing the popup until that iframe was loaded.

    For me the fix was wrapping the code that added the iframe to the HTML in:

    setTimeout(function(){
        // Code here
    },0);
    

    This way Chrome showed the popup first, after which it begin with loading the iframe.

    Maybe you have a similar problem?

    0 讨论(0)
提交回复
热议问题