Mac OS/WebView:加载本地页面后,为什么Flash和其他插件不可用? [英] Mac OS/WebView: Why Flash and other plugins are not available when a local page is loaded?

查看:136
本文介绍了Mac OS/WebView:加载本地页面后,为什么Flash和其他插件不可用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发适用于台式机Mac的Objective C应用程序.

We are working on Objective C application for desktop Mac.

我们使用WebView组件显示HTML页面.

We use WebView component to display HTML pages.

从本地文件系统加载页面时,Flash电影不会显示在页面上. 事实证明,问题并不完全与Flash有关. 大多数WebView插件丢失.

When the page is loaded from the local file system, Flash movies are not displayed on the page. As it turned out the problem is not exactly about Flash. Most WebView plugins are missing.

从Internet加载页面后,Flash会正确显示,并且有许多可用的插件.

When the page is loaded from the Internet, Flash is displayed properly and there are many plugins available.

该问题在我的Mac上没有发生,但发生在我们30%的客户中. 它是在MacBook(不是MacBook Air)上复制的,Mac OS版本是10.5.8.

The problem does not occur on my Mac, but it happens to 30% of our customers. It is reproduced on MacBook (not MacBook air), Mac OS version is 10.5.8.

伙计们,请帮助我们,我不知道该如何解决. 这是阻止我们发布产品的唯一障碍.

Guys, please help us, I have no idea how to tackle this. This is the only obstacle preventing us from the product release.

为什么加载本地页面时WebView插件不可用?

Why WebView plugins are not available when a local page is loaded?

问题的根源是什么-Safari配置,Mac安全设置,已安装某些软件?

What can be the source of the problem - Safari configuration, Mac security settings, some software installed?

如何在Mac上重现该问题?

How can I reproduce the problem on my Mac?

这是我们用于本地页面加载的WebView初始化代码.

This is our WebView initialization code for local page loading.

IBOutlet WebView* webView;
...

[[webView preferences] setPlugInsEnabled:YES];    
WebFrame *mainFrame = [webView mainFrame];

NSString* path = [NSString stringWithFormat:@"%@/page.html",[[NSBundle mainBundle] resourcePath]];
NSURL* url = [NSURL fileURLWithPath:path];  

NSURLRequest *request = [NSURLRequest requestWithURL:url];
   [mainFrame loadRequest:request];

您是否注意到任何缺陷?

Have you noticed any flaws?

更新1

测试应用程序

源代码

更新2

最低限度的测试,我只剩下了打开本地页面所需的代码. 没有显示诊断窗口. 简单的测试应用程序

Minimal test, I have left only the code necessary to open the local page. No diagnostic window displayed. Test application, simple

简单测试的应用程序委托的完整源代码

Full source code for Application Delegate of the simple test

#import "WebViewAppDelegate.h"

#import <WebKit/WebView.h>
#import <WebKit/WebFrame.h>

@implementation WebViewAppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    [[webView preferences] setPlugInsEnabled:YES];

    WebFrame *mainFrame = [webView mainFrame];
    NSString* path = [NSString stringWithFormat:@"%@/page.html",[[NSBundle mainBundle] resourcePath]];
    NSURL* url = [NSURL fileURLWithPath:path];  

    NSURLRequest *request = [NSURLRequest requestWithURL:url];
    [mainFrame loadRequest:request];

}

@end

推荐答案

好,

从下载中运行v2失败,我仍然收到插件警报并且没有螃蟹

running v2 from the download failed, I still got the plugins alert and no crab

所以我重建了xcode项目并以10.5作为目标,然后将html和swf手动移至内容中,并报告了所有的safari插件并在10.5.8上运行

so I rebuilt the xcode project and included 10.5 as a target, then manually moved the html and swf into contents and it reports all the safari plugins and runs on 10.5.8

因此,尽管您的plist说10.5 [min],但您的sdk目标是/是10.6,所以它不会在10.5上运行

so although your plist says 10.5 [min] your sdk target was/is 10.6, so it won't run on 10.5

约翰

这篇关于Mac OS/WebView:加载本地页面后,为什么Flash和其他插件不可用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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