简体   繁体   English

我可以将地址栏中的javascript代码注入Flash视频中吗

[英]Can I inject javascript code from the address bar into a flash video

借助常规HTML,只需在地址栏中输入网址并按键盘上的Enter键,就可以更改页面的外观并使用javascript制作新的Cookie。但是Flash视频呢?有没有一种方法可以对视频进行一些操作在地址栏中使用javascript的页面?

Unless I have misunderstood your question, I would advise that the last thing you would want to do is allow Javascript entered into your address bar to have any control over your page content. 除非我误解了您的问题,否则我建议您最后要做的就是允许将Javascript输入到您的地址栏中以对您的页面内容进行任何控制。

Doing so allows users to abuse your pages and is also a security threat. 这样做会使用户滥用您的页面,这也是安全威胁。

If you can avoid passing Javascript via the address bar, it is entirely possible for Javascript to 'control' flash objects on the page. 如果您可以避免通过地址栏传递Javascript,则Javascript完全有可能“控制”页面上的Flash对象。 Check this out: 看一下这个:

http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html http://livedocs.adobe.com/flex/3/langref/flash/external/ExternalInterface.html

And also this thread too: 还有这个线程:

Controlling a Flash Player using JavaScript 使用JavaScript控制Flash Player

You don't need that. 不用了
AS3 has the ExternalInterface class that deals with calling JavaScript functions from Flash. AS3具有ExternalInterface类,该类处理从Flash调用JavaScript函数的问题。
You can both call JavaScript functions and get results returned by JavaScript functions directly from Flash. 您既可以调用JavaScript函数,也可以直接从Flash获取JavaScript函数返回的结果。

All you need is read this: 您只需要阅读以下内容:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html

Added after comments: 在评论后添加:
User is asking if JavaScript placed in address bar can "mess with swf" file. 用户正在询问放置在地址栏中的JavaScript是否可以“与swf兼容”文件。 JavaScript can only mess with SWF execution of its AS code if it contains callbacks that get data from JavaScript which are not properly sanitized. 如果JavaScript包含从JavaScript获取未正确清理的数据的回调,则JavaScript只能使其SWF执行AS代码混乱。 JavaScript directly in address bar is less of a wary because using various addons, software etc (Firebug, Dragonfly) you can write as much JavaScript as you want and execute it as if it was part of that site (client side execution). 直接在地址栏中的JavaScript不需要担心,因为使用各种插件,软件等(Firebug,Dragonfly),您可以根据需要编写任意数量的JavaScript并执行它,就像它是该站点的一部分一样(客户端执行)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM