Bug 288037

Summary: [Browser] Javascript prompt/confirm/alert events in the SWT browser component
Product: [Eclipse Project] Platform Reporter: Ryan Levering <rrlevering>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: chrriis, ericwill, filip.pekarek, markward.schubert
Version: 3.6Keywords: triaged
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Suggested Patch for Prompt Listening none

Description Ryan Levering CLA 2009-08-29 17:39:08 EDT
The Browser class has no event hooks for getting dialog events for javascript confirms/alerts/prompts/etc, much like it can for HTTP authentication demands.  This is necessary for programmatically interacting with web pages, for instance to block alert boxes from popping up without disabling all of javascript.
Comment 1 Ryan Levering CLA 2009-09-02 22:12:54 EDT
Created attachment 146341 [details]
Suggested Patch for Prompt Listening

Here's my suggestion for a prompt listener and the Mozilla implementation.
Comment 2 filip.pekarek CLA 2010-04-23 16:43:56 EDT
Hello,
 is this functionality already implemeted or not yet? I would really appreciate it. If yes, how can does it work and how can I use it? Thanks a lot for reply.
Comment 3 Grant Gayed CLA 2010-04-23 16:58:32 EDT
SWT does not provide this API.

A Browser client could probably accomplish this if they embedded Mozilla on all platforms and used JavaXPCOM to register their own PromptService2Factory (see SWT's Mozilla class for an example of doing this via XPCOM).  For info about using JavaXPCOM see http://www.eclipse.org/swt/faq.php#howusejavaxpcom .
Comment 4 Ryan Levering CLA 2010-12-14 12:39:03 EST
Is the issue here that other browsers don't make it that easy?  It was quite easy to implement in Mozilla.  The only tricky part was figuring out the right interface for the events.
Comment 5 Grant Gayed CLA 2010-12-16 11:59:28 EST
Yes, last I checked, IE in particular did not provide a way to do this.  If a way is found for IE then I think this could be considered.