[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[List Home]
|
Re: [platform-swt-dev] help:why swt browser and xulrunner...
|
- From: "SerapH." <konglingpeng@xxxxxxxxx>
- Date: Thu, 29 Oct 2009 09:33:05 +0800
- Delivered-to: platform-swt-dev@eclipse.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=gw6zOPcoGeDSDdI9KwOWKa7Th45VrQeG47rIQ5sQ4Ms=; b=YrQqAOGxXQloPPmL3TzYvBPqft9sQansNyk737j4Q7X8ae25GzcbHtLCMHMwo2LdjE fbbNoDyicnLGAk/6/+LwTvsVs8nrv2iasb67q/vZlN2S/x+YAZeqlfkDOQcUCbWUrCTJ ADhirtSX+7Xh9H406x7eadjeMj9clMB15NrFg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kn7N0+yQPD59b1wW85yukg+vrresF295LFv4VCQu2Wc+ZQ46VfSSHIY469iFMJ7qpf zZHXjmBL/ID2Msws2B7Ej9gcBV9ByqTdCCR1t63AHZuWTIuxLxd7G07wj9WtDD+lhgt3 aIK9dW0XkAoNOEOf33RnrV9qTQfwe80g2BHRU=
new discover:
xulrunner1.8.1.3 works
xulrunner-sdk1.9.1.3/xulrunner1.9.0.15/xulrunner1.9.2.3583 not work
i just change code:
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", new
File("E:\\jar\\xulrunner1.9.0.15").getAbsolutePath());
please,what's the reason?
On 10/29/09, SerapH. <konglingpeng@xxxxxxxxx> wrote:
> i test again,it seams window.alert works,but onbeforeunload,onunload
> doesn't work all the same:
> //////////////////////////
> browser.addProgressListener(new ProgressAdapter() {
> public void completed(ProgressEvent event) {
> boolean b=browser.execute("var f=self.frames;
> window.alert=null;window.prompt=null;window.confirm=null;window.onunload=null;window.onbeforeunload=null;
> if(f.length>0){ for(var i=0;i<f.length;i++) {
> f[i].window.alert=null;f[i].window.prompt=null;f[i].window.confirm=null;f[i].window.onunload=null;f[i].window.onbeforeunload=null;
> } }");
> System.out.println(b);
> browser.setUrl("http://www.google.com");
> }
> });
> browser.setUrl("http://www.forexapocalypse.com/?hop=pinebux");
> ///above is my code prevent pop alert at first,it works well
>
> after i add :
> user_pref("capability.policy.default.Window.alert", "noAccess");
> user_pref("capability.policy.default.Window.confirm", "noAccess");
> user_pref("capability.policy.default.Window.onbeforeunload", "noAccess");
> user_pref("capability.policy.default.Window.onunload", "noAccess");
> user_pref("capability.policy.default.Window.open", "noAccess");
> user_pref("capability.policy.default.Window.prompt", "noAccess");
> to the prefs.js file,and delete the js execute code in complete
> event,the pop alert again,
> so why?
> i test firefox,after add capability.policy parameter,it works well.....
>
>
>
>
>
>
>
>
>
> On 10/28/09, Grant Gayed <Grant_Gayed@xxxxxxxxxx> wrote:
>> Hi,
>>
>> This works for me with xulrunner 1.8.1.3 and 1.9.1. However, instead of
>> creating the prefs.js file myself I had mozilla write it, which could be
>> the difference. Try the following:
>>
>> - launch an swt Browser with style SWT.MOZILLA
>> - navigate to about:config
>> - right-click in the preferences table and select New > String
>> -> set its name and value in the subsequent prompters
>> - close your swt app
>> - take a look at C:\Documents and Settings\Administrator\Application
>> Data\Mozilla\eclipse\prefs.js
>>
>> My test case was to set "capability.policy.default.Window.open" to
>> "noAccess", and then I viewed the page below.
>>
>> <html>
>> <script type="text/javascript">
>> setTimeout("window.open('http://www.eclipse.org', 'Dialog',
>> 'width=400, height=400');", 3000);
>> </script>
>> <body>
>> This test uses javascript to open a new window after 3 seconds.
>> </body>
>> </html>
>>
>> HTH,
>> Grant
>>
>
>
> --
> Best Regards!
> _____________________________________________
>
> kongpeng
> tel:13954108798
> QQ:38641071
> http://happy100.blogspot.com
>
--
Best Regards!
_____________________________________________
kongpeng
tel:13954108798
QQ:38641071
http://happy100.blogspot.com