This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 217267 - Install Chrome extensions dialog - take some time till IDE notices installed extension
Summary: Install Chrome extensions dialog - take some time till IDE notices installed ...
Status: VERIFIED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: Extbrowser (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Denis Anisimov
URL:
Keywords:
: 217004 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-08-23 05:54 UTC by Vladimir Riha
Modified: 2012-12-07 02:37 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Riha 2012-08-23 05:54:32 UTC
To reproduce:
- if installed, uninstall Chrome extension
- run HTML/JavaScript project
- NetBeans asks you to install the extension
- install it
- confirm the IDE's dialog that you have installed extension ("Yes, the plugin is installed now")

=> Dialog keeps popping up for some time, it takes few seconds until IDE knows about the extension.

Would it be possible to at least let user know that he may have to wait a few seconds?


Product Version: NetBeans IDE Dev (Build EaselCSS-540-on-20120822)
Java: 1.7.0_06; Java HotSpot(TM) Client VM 23.2-b09
System: Linux version 3.2.0-29-generic-pae running on i386; UTF-8; en_US (nb)
Comment 1 mikerowe81 2012-10-17 03:35:59 UTC
I also noticed this issue and wondered if I had done something incorrectly. By the time I went back and confirmed that the extension was installed in Chrome, I was able to proceed in Netbeans.
Comment 2 Denis Anisimov 2012-10-25 10:53:20 UTC
*** Bug 217004 has been marked as a duplicate of this bug. ***
Comment 3 Petr Jiricka 2012-11-27 10:12:23 UTC
I think this is quite nasty -> P2. I am also cc'ing David and Honza. Denis, it sounds like you investigated this based on your comment in bug 217004.

If this is not solvable by looking at the filesystem, could there be another solution? E.g. could the plugin after installation ping the IDE and send a message saying "I am ready"?
Comment 4 Denis Anisimov 2012-11-27 10:23:16 UTC
(In reply to comment #3)
> I think this is quite nasty -> P2. I am also cc'ing David and Honza. Denis, it
> sounds like you investigated this based on your comment in bug 217004.
> 
> If this is not solvable by looking at the filesystem, could there be another
> solution? E.g. could the plugin after installation ping the IDE and send a
> message saying "I am ready"?

Information about installed plugin appears in the plugin descriptor file after 
a while as I said in the #217004 .
So I don't see any solution here based only on the IDE.

> E.g. could the plugin after installation ping the IDE and send a
> message saying "I am ready"?
I cannot answer on that question because this is browser plugin area.
Comment 5 Jan Stola 2012-11-27 13:51:15 UTC
> If this is not solvable by looking at the filesystem, could there be another
> solution? E.g. could the plugin after installation ping the IDE and send a
> message saying "I am ready"?

There is an event that is triggered when the extension is installed or when it is updated. So, the extension can attempt to send some message to IDE in the handler for this event. Unfortunately, the IDE has no way to match such a message with the correct Web Browser. In other words, if you have both Chrome and Chromium then an extension installed into one of those can send a message to IDE but the IDE has no way to recognize where the extension was installed (i.e., if it was into Chrome or Chromium).
Comment 6 Petr Jiricka 2012-11-27 14:25:06 UTC
Thanks Honzo. Consider the entire workflow, i.e.:
1. User presses Run, dialog appears with the Go to Chrome Web Store button
2. After clicking the button, the IDE will open the plugin's page in Chrome Web Store in the browser
3. User installs the plugin; at this point the plugin should alert the IDE that it was installed
4. IDE should notice that the plugin is installed, so the user can continue to run the page

I think it is safe to assume that the browser opened by the IDE (step 2) is the same browser that sends the message back (step 3). So I think your proposed solution is fine, and we can ignore the corner case when the user between step 2 and 3 opens another browser and installs the plugin in this other browser.
Comment 7 Jan Stola 2012-11-27 14:30:45 UTC
I agree that the described problem is a corner case. I mentioned it just for the sake of completeness.
Comment 8 Denis Anisimov 2012-11-27 14:31:17 UTC
(In reply to comment #5)
> > If this is not solvable by looking at the filesystem, could there be another
> > solution? E.g. could the plugin after installation ping the IDE and send a
> > message saying "I am ready"?
> 
> There is an event that is triggered when the extension is installed or when it
> is updated. So, the extension can attempt to send some message to IDE in the
> handler for this event. Unfortunately, the IDE has no way to match such a
> message with the correct Web Browser. In other words, if you have both Chrome
> and Chromium then an extension installed into one of those can send a message
> to IDE but the IDE has no way to recognize where the extension was installed
> (i.e., if it was into Chrome or Chromium).

Is such message predefined ?
I mean we can just put the information about exact browser in the message, 
can't we ?
Comment 9 Jan Stola 2012-11-27 14:56:59 UTC
> Is such message predefined ? I mean we can just put the information about exact
> browser in the message, can't we ?

We would/will write the message handler ourselves. So, we can put into the message whatever we are able to figure out on the extension side. Unfortunately, I don't know how to identify the enclosing browser from the extension reliably.
Comment 10 Denis Anisimov 2012-11-27 15:05:55 UTC
(In reply to comment #9)
> > Is such message predefined ? I mean we can just put the information about exact
> > browser in the message, can't we ?
> 
> We would/will write the message handler ourselves. So, we can put into the
> message whatever we are able to figure out on the extension side.
> Unfortunately, I don't know how to identify the enclosing browser from the
> extension reliably.

OK, thanks, now I see.
Comment 11 David Konecny 2012-11-27 18:34:02 UTC
(In reply to comment #0)
> - confirm the IDE's dialog that you have installed extension ("Yes, the plugin
> is installed now")

An alternative solution (just for the record) could be to keep checking for the plugin in the handler of the "Yes, the plugin is installed now" button for let say 5-10 seconds. If necessary we could show a modal progress bar "waiting for the plugin to start..."
Comment 12 Denis Anisimov 2012-12-03 13:11:53 UTC
(In reply to comment #5)
> > If this is not solvable by looking at the filesystem, could there be another
> > solution? E.g. could the plugin after installation ping the IDE and send a
> > message saying "I am ready"?
> 
> There is an event that is triggered when the extension is installed or when it
> is updated. So, the extension can attempt to send some message to IDE in the
> handler for this event. 

So please send the message and provide details about the message here.
Please reassign it back after.
Comment 13 Jan Stola 2012-12-04 15:37:42 UTC
> So please send the message and provide details about the message here.
> Please reassign it back after.

Done: http://hg.netbeans.org/web-main/rev/c78d6484d78e

The name of the message is 'ready' and it has one attribute 'version' that holds the current version of the installed/updated extension. Please, let me know if this works for you and whether there is anything additional needed on my side.

BTW: The extension throws away all messages when it cannot connect to the IDE. Hence, the WebSocket server on IDE-side must be running when the extension is being installed/updated (for the 'ready' message to reach the IDE).
Comment 14 Denis Anisimov 2012-12-05 06:26:57 UTC
web-main#126f472237f3
Comment 15 Vladimir Riha 2012-12-06 09:54:05 UTC
Thanks, now after I confirm that extension is installed the page is opened in browser immediately


Product Version: NetBeans IDE Dev (Build web-main-9444-on-20121206)
Java: 1.7.0_10; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 16 Quality Engineering 2012-12-07 02:37:18 UTC
Integrated into 'main-golden', will be available in build *201212070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/126f472237f3
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#217267 - Install Chrome extensions dialog - take some time till IDE notices installed extension