有没有办法使用WebKit Web检查器从Cocoa WebView对象? [英] Is there a way to use the WebKit web inspector from a Cocoa WebView object?

查看:227
本文介绍了有没有办法使用WebKit Web检查器从Cocoa WebView对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在基于OS X上的WebKit的自定义浏览器中使用WebKit Web检查器。是否可以在Webview对象上使用Web检查器?

I would like to use the WebKit web inspector in a custom browser based on WebKit on OS X. Is it possible to use the web inspector on a webview object? If so, how?

推荐答案

WebKitDeveloperExtras 设置为<$ c $当您发送 - [NSUserDefaults registerDefaults:] 时,您的默认用户默认值为c> YES

Set WebKitDeveloperExtras to YES in your default user defaults when you send -[NSUserDefaults registerDefaults:]. This applies app-wide, of course.

请记住,用户可以将其更改为 NO t假设它是 YES - 如果它有重要的(例如,当自定义上下文菜单),总是检查。

Remember that the user can change it to NO, so don't assume that it's YES—if it ever matters (e.g., when customizing the contextual menu), always check.

警告:此首选项不一定只启用元素检查器。苹果可能会扩展它在未来还控制,例如,在菜单栏中的调试菜单。您可能会发现这是不可接受的风险。

Warning: This preference doesn't necessarily only enable the Element Inspector. Apple may extend it in the future to also control, say, a Debug menu in your menu bar. You may find this an unacceptable risk.

这篇关于有没有办法使用WebKit Web检查器从Cocoa WebView对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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