开发者

Detecting flash on a web page

开发者 https://www.devze.com 2023-01-07 23:12 出处:网络
I want to programmatically detect flash on a web page. From my search, I understand I need to parse the code and look for embed tags that have the attribute \"application/x开发者_如何学运维-shockwave

I want to programmatically detect flash on a web page.

From my search, I understand I need to parse the code and look for embed tags that have the attribute "application/x开发者_如何学运维-shockwave-flash".

Is that all? Or there are other ways to embed flash into a web page?

Thank you.


There are only two tags that can be used to embed the Flash Player Plugin: <embed> and <object>

<embed> only works in Netscape & friends, and it is only ever used in addition to the <object> tag, so you can safely ignore it when you are searching the DOM.

<object> is the tag you are looking for, specifically when its "type" attribute is set to "application/x-shockwave-flash"

Here is a typical implementation of the tag:

<object type="application/x-shockwave-flash" data="/DTV.swf" width="100%" height="100%">
    <param name="allowFullscreen" value="true">
    <param name="wmode" value="window">
    <param name="allowscriptaccess" value="always">
</object>

Also be aware that the <object> tag is often injected into the DOM on the client-side using Javascript as a work-around to an IE issue, so if you are searching the HTML on server-side using PHP, it's possible that the <object> tag will not yet be written into the HTML


Your question is very vague, from what language do you want to write a program to detect Flash? Do you want to have to right-click and download the source, or have a client side program, or a web based application where you type in the URL of the page?

If you want to right-click and download, you can use notepad.

If you want to write your own client side program, you can use anything from Java to C#, however, what you are asking to do is more or less write your own web browser without the front end interpreter (the part that decides how to render the HTML/data it receives). This will be slightly easier than writing a full blown browser, but it's still pretty advanced.

https://developer.mozilla.org/En

If you want to write a web based application, you have a slight bit easier of a time as you can use various techniques to pull the html data off a page from another page. You are essentially parsing another page. W3C has some open source validation software (the stuff that tells you if your site is W3 compliant or not) which may help you on your journey.

http://www.w3.org/Status

Altogether, you're facing a pretty tough road ahead, and I wish you luck :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号