Popup Taking a Long time to Load

1,608 views
Skip to first unread message

nrusan

unread,
Jun 9, 2010, 11:50:37 PM6/9/10
to Chromium-extensions
Hey,

Sometimes when I click the browser action button, it just freezes, and
it takes several seconds before my application appears. All my calls
are asynchronous, so this is not the issue. Also, we have optimized it
so that the first thing that happens is it draws the minimal necessary
html, and then begins the heavier JS work.

I am wondering what may be causing this variance in load time for
popup.html after pressing the browser action button. Could it be
jquery event listeners that have remained? Is this a possibility that
it could be due to event listeners that are still bound?

Are other people experiencing this behavior?

Thanks for your help.

Nicolae

Brian Kennish

unread,
Jun 11, 2010, 9:50:22 AM6/11/10
to nrusan, Chromium-extensions
On Wed, Jun 9, 2010 at 8:50 PM, nrusan <nicola...@gmail.com> wrote:
> Sometimes when I click the browser action button, it just freezes, and
> it takes several seconds before my application appears.

I'm guessing you're running into http://crbug.com/39209. You can work
around the issue by adding

onload = setTimeout(initialize, 0);

to your popup, where "initialize" is the code to render the popup.

Ekaterina Kamenskaya

unread,
Aug 30, 2011, 10:58:29 AM8/30/11
to nrusan, Chromium-...@chromium.org
I have set timeout:
<body onload="setTimeout('brt.popup.getInstance().init',0);">

But in most cases it takes much longer time to show/load my popup when
I click on popup icon (browser action) - in comparison with the case
when I select "Inspect popup" in context menu for popup. In the last
case popup is opened/loaded instantly. Why does it happen?

Boris Smus

unread,
Aug 30, 2011, 5:03:11 PM8/30/11
to Ekaterina Kamenskaya, nrusan, Chromium-...@chromium.org
Hi Ekaterina,

The original poster's issue should be fixed by http://crbug.com/56340. Why do you need the setTimeout? Is there a bug you are seeing? If so, please file it using new.crbug.com.

- Boris


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


Ekaterina Kamenskaya

unread,
Oct 27, 2011, 12:56:32 AM10/27/11
to Boris Smus, nrusan, Chromium-...@chromium.org
Hi Boris, 

I have an issue in my Chrome extension. It's described here, and it's rather critical for my tool. So, basically when user clicks on Chrome extension icon/badge, often it happens that popup shows just default message "Please, wait", but after that nothing happens. In many cases when I mouse over the page after clicking on the icon, the popup works fine. But not always.

I would like to fix it, but I don't know what is causing the issue. I should probably spend more time debugging this....
I wonder if this is a problem of my tool or not.

The related source code:

If you have any idea, why this may happen, please, let me know.

Thanks very much,
Ekaterina
--
With best regards,
Ekaterina Kamenskaya
Software Engineer in Test

Google
Alia Tempora Business Center, Floors 8-9
3B Mayakovskogo str.
St. Petersburg, Russia
ph: +7 812 313-4946
fax: +7 812 313-4801

Boris Smus

unread,
Oct 27, 2011, 11:05:22 AM10/27/11
to Ekaterina Kamenskaya, nrusan, Chromium-...@chromium.org
Hi Ekaterina,

I would spend some time debugging your extension using the devtools. Right click the browser action and select inspect popup, then step through your code and also look for errors in the console. For more info see here: http://code.google.com/chrome/devtools/docs/overview.html

- Boris
--
Ask your next question on Stack Overflow, using the google-chrome-extension tag.

Ekaterina Kamenskaya

unread,
Oct 27, 2011, 11:36:36 AM10/27/11
to Boris Smus, nrusan, Chromium-...@chromium.org
Yes, I am going to do this today. Will let you know, what I find out.

Thanks a lot,
Ekaterina

Ekaterina Kamenskaya

unread,
Nov 8, 2011, 10:56:56 AM11/8/11
to Boris Smus, nrusan, Chromium-...@chromium.org
Hi Boris, 

I have found the problem and fixed it. Now extension popup opens reliably, that was issue in my tool.

Then I added timer object which invokes some methods each 3 seconds. After that my extension started to crash (in some time after usage), with such error: 

V8 error: Could not convert to object (v8::Object::Cast()).  Current memory usage: 15 MB
[31539:31539:514803147307:INFO:CONSOLE(174)] "Uncaught Error: Attempting to use a disconnected port object", source: extensions/renderer_extension_bindings.js (174)

I thought that it happens because of frequent message passing between background and content scripts. So, I have just changed to long live connection (connect, onConnect). 

I get such error sometimes though (not sure what causes it), e.g. on google.com

  1. Error in event handler for 'undefined': TypeError: Cannot read property 'hasPort' of undefined at http://ssl.gstatic.com/gb/js/sem_93503e9315a5733d20e53739a0bde88e.js:12:466 at HTMLAnchorElement.<anonymous> (http://ssl.gstatic.com/gb/js/sem_93503e9315a5733d20e53739a0bde88e.js:13:108)
    1. chrome.Event.dispatchextensions/event.js:181
    2. chromeHidden.Port.dispatchOnMessageextensions/renderer_extension_bindings.js:164
 

Possibly this exception appears only when I activate 'pause on exception' functionality in Chrome Debugger. Could you, please, let me know why this exception may happen and advice how I can debug/fix it?


Thanks,
Ekaterina
Reply all
Reply to author
Forward
0 new messages