Java人员需要弹出检测建议 [英] Pop-up detection advice needed by Java folks

查看:70
本文介绍了Java人员需要弹出检测建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在comp.lang.java.programmer上,我们讨论了弹出窗口阻止程序为Java

程序创建的问题(在线程中showDocument被新的阻止了$ / b $ b微软弹出窗口阻止程序)。我们的问题是Java的showDocument方法,

打开新的浏览器窗口,被一些弹出窗口阻止程序阻止。即使用户单击Java

程序中的按钮来调用showDocument,也会阻止

showDocument方法。因此,HTML页面中允许的一种用户启动的

功能在Java applet中被阻止。


我们理解Java程序员是抵押品在更大的战斗中损坏,

但是想要使用JavaScript来检测弹出窗口拦截器的建议。


我们的问题仅限于某些环境。 Netscape和Safari

弹出窗口阻止程序不会阻止showDocument。相比之下,Google和

微软弹出窗口阻止程序会阻止showDocument。我们想在适当的环境中检测弹出窗口阻止程序,并告诉用户我们的

Java软件不能很好地工作,除非他们将网站添加到他们的弹出窗口

可信站点。


我们已经看到各种提及没有好方法来检测弹出窗口

阻滞剂。但是,由于我们的需求似乎仅限于Windows上的Internet Explorer,我们的需求可能比解决一般问题更简单。

以下代码是否适合检测Internet中的弹出窗口阻止程序

Explorer for Windows(请参阅
http://www.segal.org/js/pop_detect/):
< br $>
主页:


< script language = javascript>

result = window.open(" popped.html", " popped"," width = 10,height = 10,

location = no,menubar = no,status = no,toolbar = no,scrollbars = no,

resizable = no");

if(result!= null)html =" is not blocking" ;;

else html =" is blocking";

document.write(html);

< / script>


弹出页面:

< script language = javascript>

window.close();

< / script>


如果这段代码不合适,知道原因会有所帮助,并且

它会是偶数更有帮助的是知道可以更好地工作的代码。

On comp.lang.java.programmer we are discussing problems created for Java
programs by pop-up blockers (in the thread "showDocument blocked by new
microsoft pop-up blocker"). Our problem is that Java''s showDocument method,
which opens new browser windows, is blocked by some pop-up blockers. The
showDocument method is blocked even if the user clicked a button in a Java
program to call showDocument. As a result, a type of user-initiated
functionality allowed in an HTML page is blocked in a Java applet.

We understand the Java programmers are collateral damage in a larger fight,
but would like advice on using JavaScript to detect pop-up blockers.

Our problem is restricted to certain environments. The Netscape and Safari
pop-up blockers do not block showDocument. In contrast, the Google and
Microsoft pop-up blockers do block showDocument. We would like to detect
pop-up blockers in appropriate environments and tell the user that the our
Java software won''t work well unless they add the site to their pop-up
trusted sites.

We have seen various mentions of there being no good way to detect pop-up
blockers. However, since our needs seem restricted to Internet Explorer on
Windows our needs may be simpler than solving the general problem. Is the
following code appropriate for detecting pop-up blockers in Internet
Explorer for Windows (see it in action at
http://www.segal.org/js/pop_detect/):

Main page:

<script language = javascript>
result = window.open("popped.html", "popped", "width=10, height=10,
location=no, menubar=no, status=no, toolbar=no, scrollbars=no,
resizable=no");
if (result != null) html = "is not blocking";
else html = "is blocking";
document.write(html);
</script>

Popped-up page:

<script language = javascript>
window.close();
</script>

If this code would not be appropriate it would be helpful to know why, and
it would be even more helpful to know of code that would work better.

推荐答案

在文章< 41 ************* **********@news.rcn.com>, ig ***** @ example.com

启发我们...
In article <41***********************@news.rcn.com>, ig*****@example.com
enlightened us with...

我们理解Java程序员在更大的战斗中是附带损害,
但是想要使用建议用于检测弹出窗口阻止程序的JavaScript。


祝你好运。 :)

每当有人弄明白时,人们会用它来做坏事,然后更新的

阻挡者绕过它,依此类推......

我们想在适当的环境中检测弹出窗口阻止程序并告诉用户我们的Java软件不能很好地工作,除非他们将网站添加到弹出窗口中
/>可信赖的网站。


您最好的选择就是将该信息放在页面上供所有人阅读。

但是,请参阅下面的评论.. 。

主页:

< script language = javascript>


不推荐使用language属性。使用类型。

< script type =" text / javascript">

result = window.open(" popped.html"," popped", width = 10,height = 10,
location = no,menubar = no,status = no,toolbar = no,scrollbars = no,
resizable = no");
if(/结果!= null)html =" is not blocking" ;;


如果结果为空,可能很容易因为连接速度慢而导致页面无法加载

。或者用户可能已经快速关闭(我认为)F4键。


所有它告诉你的是窗口不在那里。不是为什么它不存在。

其他html ="阻止" ;;
document.write(html);

We understand the Java programmers are collateral damage in a larger fight,
but would like advice on using JavaScript to detect pop-up blockers.

Good luck. :)
Every time someone figures it out, people use it for bad things, then newer
blockers go around it, and so on...
We would like to detect
pop-up blockers in appropriate environments and tell the user that the our
Java software won''t work well unless they add the site to their pop-up
trusted sites.

Your best bet is simply to place that message on the page for all to read.
But, see my comments below...

Main page:

<script language = javascript>
The language attribute is deprecated. Use type.
<script type="text/javascript">
result = window.open("popped.html", "popped", "width=10, height=10,
location=no, menubar=no, status=no, toolbar=no, scrollbars=no,
resizable=no");
if (result != null) html = "is not blocking";
If result is null, it may easily be that the page hasn''t finished loading
because of a slow connection. Or the user may have closed it quickly with (I
think) the F4 key.

All it tells you is that the window isn''t there. Not WHY it isn''t there.
else html = "is blocking";
document.write(html);




document.write有很多很多问题,我不会在这里讨论,因为你只需要用它进行测试。如果您希望在实际代码中使用它,请注意。 :)


无论如何,如果有一个很好的方法来告诉用户是否有一个弹出窗口阻止程序,那么

就会赚钱了。 *笑嘻嘻*

所以,对不起,没有办法告诉这个正常的客户端 -

方javascript。你可以判断是否定义了一个窗口句柄,但是你只能告诉空句柄的根本原因。

(注意:如果您使用的是HTA或ActiveX,您可以根据

用户的注册表,权限允许,但这并不是真的有效这个

讨论,因为你必须知道拦截器的名称,等等)


-

-

~kaeli~

用户:计算机专业人员使用的词语是什么意思

''白痴''。
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace



document.write has many, many problems I won''t go into here because you''re
just using it for a test. Should you wish to use it in real code, beware. :)

Anyway, if there were a good way to tell if a user had a popup blocker, it
would be making money already. *grins*
So, sorry, there just isn''t a way to tell this exactly with normal client-
side javascript. You can tell if a window handle is defined or not, but you
just can''t tell the root cause of a null handle.

(note: if you are using an HTA or ActiveX, you can go rooting around the
user''s registry, permissions allowing, but that isn''t really valid in this
discussion, as you''d have to know the name of the blocker, and so on)

--
--
~kaeli~
User: The word computer professionals use when they mean
''idiot''.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


2004年8月30日星期一16:15:50 -0500,kaeli< ti ****** @ NOSPAM.comcast.net>

写道:


[snip]
On Mon, 30 Aug 2004 16:15:50 -0500, kaeli <ti******@NOSPAM.comcast.net>
wrote:

[snip]
如果结果为null,可能很容易因为连接速度慢而导致页面无法完成加载。或者用户可能已经(我认为)F4键快速关闭它。


Alt + F4关闭Windows中的应用程序。我会用Ctrl + F4来关闭一个MDI

的孩子(一个Opera选项卡)。

它告诉你的是窗口是不存在的。不是为什么它不存在。


我似乎记得在几个月前的最后一次重大讨论中,

弹出窗口阻止程序可以伪造一个窗口对象。得到一个对象引用

并不是什么意思,但至少你不会产生错误(如果

你在使用方法之前进行了特征测试,当然)。


[snip]

用户:计算机专业人员在他们的意思是''idiot'时使用的词。
If result is null, it may easily be that the page hasn''t finished
loading because of a slow connection. Or the user may have closed it
quickly with (I think) the F4 key.
Alt+F4 closes an application in Windows. I''d use Ctrl+F4 to close a MDI
child (an Opera tab).
All it tells you is that the window isn''t there. Not WHY it isn''t there.
I seem to remember in the last major discussion several months ago that
pop-up blockers can fake a window object. Getting an object reference
doesn''t really mean anything, but at least you won''t generate an error (if
you feature test before using methods, of course).

[snip]
User: The word computer professionals use when they mean''idiot''.




大声笑。非常好。 :D


Mike


-

Michael Winter

替换 。无效"与.uk通过电子邮件回复。



LOL. That''s good. :D

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


" kaeli" < TI ****** @ NOSPAM.comcast.net>在留言中写道

新闻:MP ************************ @ nntp.lucent.com ...
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
最好的办法就是将该信息放在页面上供所有人阅读。


这就是我们现在所做的,但问题是用户要等到他们需要的第一个弹出窗口才会被阻止。然后他们允许站点弹出窗口。

不幸的是,允许站点弹出窗口的操作重新启动Java

applet并且用户丢失了他们的工作。对于

Google和Microsoft弹出窗口阻止程序,都会重新启动。

不推荐使用language属性。使用类型。
< script type =" text / javascript">


谢谢。

如果结果为空,由于连接速度慢,页面可能很容易因为加载而无法完成加载。或者用户可能已经快速关闭它(我认为)F4键。


弹出窗口未下载;它是由原始页面创建的,所以

我不认为我们会遇到下载时间问题。我曾试图抓住那个窗口并手动关闭它,但它太快了。 (顺便说一句,

有一些方法可以将弹出的窗口放在特定的位置,这样它会不太可能被用户注意到吗?)

无论如何,如果有一个很好的方法来告诉用户是否有弹出窗口阻止程序,那么
就已经赚钱了。 * grins *
Your best bet is simply to place that message on the page for all to read.
That is what we do now, but the problem is that the users wait until the
first pop-up that they need is blocked. Then they allow site pop-ups.
Unfortunately, the operation of allowing site pop-ups re-starts a Java
applet and the user loses their work. This re-starting occurs for both the
Google and Microsoft pop-up blockers.
The language attribute is deprecated. Use type.
<script type="text/javascript">
Thanks.
If result is null, it may easily be that the page hasn''t finished loading
because of a slow connection. Or the user may have closed it quickly with
(I
think) the F4 key.
The pop-up window is not downloaded; it is created by the original page, so
I don''t think we will run into download time issues here. I''ve tried to
catch that window and close it manually but it is much too fast. (BTW, is
there some way to position the popped window at a particular location so it
would be less likely to be noticed by the user?)
Anyway, if there were a good way to tell if a user had a popup blocker, it
would be making money already. *grins*




如果用户不打败网站,用户不会同意网站弹出窗口。

我们的用户已经接受了我们的数字证书,但他们对按钮启动的弹出窗口具有较低的

权限,这些弹出窗口可以执行常规HTML页面。


BTW,I刚刚尝试使用Firefox for Windows,和Netscape一样,它也允许使用

Java的showDocument。



A user is not going to agree to site pop-ups if they don''t truat the site.
Our users have already accepted our digital certificate, yet they have lower
privileges for button-initiated pop-ups that does a regular HTML page.

BTW, I just tried Firefox for Windows, and like Netscape it also allows
Java''s showDocument.


这篇关于Java人员需要弹出检测建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆