之前查了很多资料,最近也在挖掘研究这方面的漏洞.

windows的很简单,在注册表配置就好了,但是mac os 是unix的,没有注册表这么一说。

但是发现腾讯等配置了自定义等协议,例如:tencent://xxxxx,

那么他们是怎么配置的,查了写资料,比较少。分享一下:

mac应用程序安装的时候在安装软件有一个info.plist,可以在配置文件中配置CFBundleURLName.

1. Use Script Editor to save this script as an Application Bundle (no startup screen):

on open location localURL

    set oldDelims to AppleScript's text item delimiters
set AppleScript's text item delimiters to "local://"
set thePath to item 2 of the text items of localURL
set AppleScript's text item delimiters to oldDelims tell application "System Events"
open ((POSIX file thePath) as string)
end tell end open location

2.Use the method described here and here to set CFBundleSignature to LOCL and add

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>Local File</string>
<key>CFBundleURLSchemes</key>
<array>
<string>local</string>
</array>
</dict>
</array>
<key>NSUIElement</key>
<true/>

to the application bundle's Info.plist file, then change the PkgInfo file to contain APPLLOCL
3.Use the More Internet preference pane to add 'local' as a new protocol and choose the new application as the handler.
4.Make hyperlinks in the form local:///path/to/your/local/folder. Clicking those links should then open that file or folder.

更详细的可以到苹果开发文档参考:

https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

以我的电脑为例:

例如在链接中<a href="ssh://xxx">click me</a>那么就会唤iTerm程序来执行ssh

关于伪协议,其中有很多好玩的东西,大家可以自己挖掘。

参考:

http://hublog.hubmed.org/archives/001154.html

https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

https://code.i-harness.com/zh-CN/q/7321d

最新文章

  1. 在ASP.NET Core应用中如何设置和获取与执行环境相关的信息?
  2. Android -- PopupWindow(其中嵌套ListView 可以被点击)
  3. centos7 docker redis
  4. Linux 知识框架
  5. Android 常用的adb命令
  6. Linux之保留yum安装软件后的RPM包
  7. [Unity3D]unity3d5.0简单的调用摄像头
  8. Android工具:延展图片NinePatch
  9. [LeetCode 121] - 买入与卖出股票的最佳时机(Best Time to Buy and Sell Stock)
  10. Snippet Compiler——代码段编译工具
  11. php 制作圆形图片
  12. ROS_Kinetic_x 目前已更新的常用機器人資料 rosbridge agvs pioneer_teleop nao TurtleBot
  13. javascript prop和attr的区别
  14. I/O多路复用之 epoll 详解
  15. redis学习-散列表常用命令(hash)
  16. QML-关于Qt.rgba()颜色无法正常显示问题
  17. 给定一个数组,将数组中的元素向右移动 k 个位置,其中 k 是非负数。
  18. php数据库单例模式理解
  19. personalblog
  20. 33 【kebernetes】一个错误的解决方案

热门文章

  1. srs部署到ubuntu 18.04 server
  2. Flexible实现H5页面的rem布局适配
  3. JDeveloper 10g Certified on Windows 10 for EBS 12.1
  4. MongoDB GridFS——本质上是将一个文件分割为大小为256KB的chunks 每个chunk里会放md5标识 取文件的时候会将这些chunks合并为一个整体返回
  5. 原生JS日历 + JS格式化时间格式
  6. 【spark】IDEA建立基于scala语言的spark项目
  7. ARM汇编指令集1
  8. canvas压缩图片成base64,传到后台解码需要注意的问题
  9. LeetCode OJ:Rotate Image(旋转图片)
  10. javaBean和mvc思想