Bug 288037 - [Browser] Javascript prompt/confirm/alert events in the SWT browser component
Summary: [Browser] Javascript prompt/confirm/alert events in the SWT browser component
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2009-08-29 17:39 EDT by Ryan Levering CLA
Modified: 2017-07-28 10:11 EDT (History)
4 users (show)

See Also:


Attachments
Suggested Patch for Prompt Listening (20.41 KB, patch)
2009-09-02 22:12 EDT, Ryan Levering CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.