Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FAQ and How to Review Error Logs 常见问题和如何查看错误日志 #409

Open
ACTCD opened this issue Jan 5, 2023 · 0 comments
Open

Comments

@ACTCD
Copy link
Collaborator

ACTCD commented Jan 5, 2023

Frequently Asked Questions(常见问题)

Q: "Safari Extension State Unknown" or the extension does not show in Safari

Q:扩展显示为上述状态 或 Safari 设置中未显示该扩展项

We've seen several users experience this issue, and it appears to be an upstream issue, but thanks to @djpadz for tried, we now have a simple workaround:
我们看到有几个用户遇到该问题,它似乎是一个上游问题,但感谢 @djpadz尝试,我们现在有一个简单的解决方法:

  • Quit Safari, then open the macOS Terminal app paste and run the following command, done. [ref]
  • 退出 Safari,然后打开 macOS 的 终端 应用粘贴并运行下面的命令,完成。
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f -R /Applications/Safari.app

Q: Script cannot be injected due to the Content Security Policy (CSP) of the page or site

Q:由于页面或站点的内容安全策略 (CSP),无法注入脚本

Sorry, currently we don't have a way to bypass CSP protection in Safari due to strict extension API restrictions and lack thereof.
For injecting page contexts, there is nothing we can do at the moment, but if your case allows it, try to use content scripts contexts for your user scripts, please refer to: #106 (comment)
抱歉,当前我们没有办法在 Safari 中绕过 CSP 保护由于严格的扩展 API 限制和缺失。
对于注入页面上下文,当前我们没有什么可以做的,但是如果您的案例允许,尝试使用内容脚本上下文来实现您的用户脚本,请参考:#106 (comment)


How to Review Error Logs(如何查看错误日志)

Since this extension respects user privacy and does not collect any usage information, when you encounter errors or report issues, you may need to review and provide error logs to help us locate and solve your issues. Here's how to view the different parts of the error logs.
由于此扩展尊重用户隐私,未收集任何使用信息,当您遇到错误或报告问题时,您可能需要查看和提供错误日志以帮助我们定位和解决您的问题。以下是查看不同部分错误日志的方法。

The Extension/App is made up of several parts that work together:
该 扩展/App 由几个部分协同运行:

  • Native application(本地应用)

    • In this part, you need to review the error logs through the console application of the macOS system.
    • 此部分您需要通过 macOS 系统 控制台 应用来查看错误日志。
  • Safari extension(Safari 扩展)

    • background page(背景页面)

      • You need to Show "Develop" menu in Safari Preferences, then open the background page inspector from this menu.
      • 您需要在 Safari 设置中显示“开发”菜单,然后从此菜单中打开背景页面检查器。
    • popup page(弹出页面)

      • You need to open the popup and then open the web inspector via the context menu (Inspect Element) in popup page.
      • 您需要点开弹出页面,然后通过页面中的上下文菜单(检查元素)打开网页检查器。
    • extension page(扩展页面)

      • You need to open the extension page, then click "Show JavaScript Console" from the "Develop" menu or use the shortcut key ⌥ ⌘ C to open the console.
      • 您需要打开扩展页面,然后从“开发”菜单中点击“显示JavaScript控制台”或使用快捷键 ⌥ ⌘ C 打开控制台。
    • content scripts and user scripts(内容脚本 和 用户脚本)

      • You need to open the site where the script matches, then click "Show JavaScript Console" from the "Develop" menu or use the shortcut key ⌥ ⌘ C to open the console.
      • 您需要打开脚本匹配的网站,然后从“开发”菜单中点击“显示JavaScript控制台”或使用快捷键 ⌥ ⌘ C 打开控制台。

@quoid explained how to review error logs through a more detailed graphic introduction in some issues:
@quoid 在一些 Issues 中通过更详细的图文介绍解释了如何检查错误日志:
#245 (comment) , #201 (comment)

You can also refer to Apple's developer documentation:
您还可以参考 Apple 的这篇开发文档:
Troubleshooting your Safari web extension

@ACTCD ACTCD pinned this issue Jan 5, 2023
Repository owner locked and limited conversation to collaborators Jan 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant