参考网址:

http://blog.csdn.net/eroswang/article/details/1594795

http://hi.baidu.com/pluto632/item/5007737da31344326f29f666

http://msdn.microsoft.com/en-us/library/aa767914.aspx#prot_sec

http://msdn.microsoft.com/en-us/library/ie/aa767914(v=vs.85).aspx

http://kb.mozillazine.org/Register_protocol

http://superuser.com/questions/162092/how-can-i-register-a-custom-protocol-with-xdg

https://support.shotgunsoftware.com/entries/86754-How-to-launch-external-applications-using-custom-protocols-rock-instead-of-http-

针对ubuntu

1:

All Firefox versions
(Requires certain Gnome libraries to be installed)
In a terminal, type:
gconftool-2 -s /desktop/gnome/url-handlers/foo/command '/path/to/app %s' --type String
gconftool-2 -s /desktop/gnome/url-handlers/foo/enabled --type Boolean true
Replace foo on both lines with the protocol you want to register and /path/to/app with the path to the application you want to run.

以上如果不行,可以试试一下操作
gconftool-2 -t string -s /desktop/gnome/url-handlers/foo/command 'foo "%s"'gconftool-2 -s /desktop/gnome/url-handlers/foo/needs_terminal false -t boolgconftool-2 -s /desktop/gnome/url-handlers/foo/enabled true -t bool

2:

在firefox地址栏输入about:config,出现如下界面

之后firefox version >3.5 执行一下操作

在preference name 下面,右键-》new,选择不同的类型建立不同的值

主要是如下几个值:

最后的testfile,要替换成你自己的协议。

并且要确保network.protocol-handler.expose-all 为true

3.

建立应用程序的桌面文件:/usr/share/applications/testfile.desktop (文件名称应该要与协议名称一样)

内容如下:

[Desktop Entry]
Encoding=UTF-8
Name=testfile
Comment=testfile
Exec=/home/ubuntu/workspace/test_file/Debug/test_file %u
Terminal=false
StartupNotify=true
Type=Application
Categories=Application;Internet;
Name[en_US]=testfile

之后在 /etc/gconf/gconf.xml.defaults/%gconf-tree.xml文件中添加以下内容

x-cheme-handler/testfile=testfile.desktop
application/x-testfile=testfile.desktop
application/testfile=testfile.desktop

然后在~/.local/share/applications/mimeapps.list文件中添加以下内容

[Default Applications]            //这一行必须要有x-scheme-handler/testfile=testfile.desktop
application/x-testfile=testfile.desktop
application/testfile=testfile.desktop

4.

之后在firefox地址栏中输入testfile://就能弹出你想要打开的程序

转载于:https://www.cnblogs.com/flyingdirt/p/3776903.html

ubuntu 配置url地址重定向协议相关推荐

  1. apache2.2.21下为codeigniter配置url地址重写

    2019独角兽企业重金招聘Python工程师标准>>> apache2.2.21下为codeigniter配置url地址重写 1.首先打开apache的配置文件,httpd.conf ...

  2. 虚拟机下Ubuntu配置IP地址和网段

    服务器密码机的地址是172.27.120.99 ubuntu系统的IP地址是192.168.133.138,使用net方式和主机共享网络.现需要修改ip地址 第一步,net方式是不对的,需要选择桥接方 ...

  3. ubuntu配置IP地址,网关,DNS和路由

    配置IP地址 临时添加,重启失效 查看IP地址 使用ifconfig命令查看IP地址:ifconfig # ip地址为192.168.191.137 使用ip命令查看IP地址:ip addr # ip ...

  4. linux ubuntu配置ip地址命令,Ubuntu系统下配置IP地址方法介绍

    接到一客户的服务器,开机已启动发现是Ubuntu系统,当时有点郁闷了,心想没有配置过ubuntu系统,这客户还在旁边了,心里有点紧张了,于是开始上网寻找各种方法配置,最终将IP配置好,给客户上架调试通 ...

  5. Ubuntu配置IP地址

    Ubuntu20.04设置方法 配置文件位置:/etc/netplan/00-installer-config.yaml DHCP配置: network:ethernets:ens33:dhcp4: ...

  6. 酷我音乐mp3歌曲URL地址提取(作背景音乐)

    现在网上酷狗.虾米.网易音乐等因版权问题很多mp3音乐都要付费才能下载.现在很多都是通过http://vdisk.weibo.com/微盘搜索来下载,现在这个网址无法搜索到,原因微盘将暂停分享及站内搜 ...

  7. nginx配置url重定向-反向代理

    本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com  IP: 192.168.10.128 apache主机,hostname: c ...

  8. 详解nginx配置url重定向-反向代理

    本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com  IP: 192.168.10.128                    a ...

  9. nginx代理 指向_详解nginx配置url重定向-反向代理

    本文系统:Centos6.5_x64 三台主机:nginx主机,hostname: master.lansgg.com  IP: 192.168.10.128 apache主机,hostname: c ...

最新文章

  1. Java中数组常见的几种排序方法!
  2. ubuntu 更新mysql后无法登陆_更新ubuntu之后无法登陆mysql
  3. python中的散点图代码-python – 带有图例的matplotlib散点图
  4. 一天搞定CSS:背景background--03
  5. python 画布 保存_Python Tkinter使用PIL将画布保存为图像
  6. 解决 swap file “*.swp”already exists!问题
  7. 直接学python3_学习python用python2还是python3
  8. Democracy Player 0.8.5
  9. java me手机版,一个经典的 JAVA ME 手机程序入门级源码
  10. 调试器如何工作(2)
  11. 单位计算机ping网关不通,电脑ping不通自己的网关有什么原因(解决ping不通网关的原因)...
  12. 《读书的力量》读后感作文4000字
  13. 全屏滚动插件之 fullpage.js
  14. 资深iOS/Android开发工程师
  15. QT 实现类似于qq的登录注册界面
  16. Vue 3的provide和inject用法
  17. 海龟绘图小案例(内含源码)
  18. Matplotlib的中文字体显示为方块的问题
  19. php think-queue队列的安装使用和Supervisor的安装配置和使用
  20. Dog Whisper--报告狗班长——狗的心理专家

热门文章

  1. JS在火狐浏览器下如何关闭标签?
  2. [转载]从零开始学习jQuery (一) 开天辟地入门篇
  3. dynamic_cast详解
  4. 编译bluez-5.25 遇到的错误及解决方法
  5. 系统业务逻辑书籍_咨询行业书籍推荐
  6. Linux 系统之虚拟化部署
  7. P1003 铺地毯(模拟)
  8. 庖丁解牛-图解MySQL 8.0优化器查询解析篇
  9. ThingJS:部署物联网不用买买买,互联互动是切入点
  10. 开放下载!《AliOS Things快速开发指南》