如何使用firefox打开终端?

如何使用firefox打开终端?,firefox,permissions,terminal,sh,execute,Firefox,Permissions,Terminal,Sh,Execute,我有一个扩展名为.sh的可执行文件。我想通过firefox和Terminal打开此文件,但返回错误: 无法打开“filename.sh”,因为不允许Firefox在终端中打开文档 现在,如何更改权限以解决此问题?它通常被禁用,因为它会允许恶意软件损坏您的文件。例如,此STIG查看器主题 但是,它是可配置的,称为“Shell协议”。这篇博客文章详细介绍了它的设置 network.protocol-handler.external.shell(true) network.protocol-hand

我有一个扩展名为.sh的可执行文件。我想通过firefox和Terminal打开此文件,但返回错误:

无法打开“filename.sh”,因为不允许Firefox在终端中打开文档


现在,如何更改权限以解决此问题?

它通常被禁用,因为它会允许恶意软件损坏您的文件。例如,此STIG查看器主题

但是,它是可配置的,称为“Shell协议”。这篇博客文章详细介绍了它的设置

  • network.protocol-handler.external.shell(true)
  • network.protocol-handler.app.install(自定义shell)
  • network.protocol-handler.app.shell(自定义shell)

在所有使用javascript的现代浏览器中都可以找到一种更安全的方法:

  • 安装websocketd服务器(单静态链接二进制) 下载自

  • 启动websocketd服务器:

    ./websocketd--port=8080--devconsole./command.sh

  • 编写一个HTML页面和一个小bash脚本

  • HTML:

         <button type = "button"
                      onclick = ws.send("xterm\040#started")>xterm </button>
    
            #!/bin/bash
            export DISPLAY=:0.0
            while read command
              do
                eval $command
              done
    
    Bash脚本(command.sh):

         <button type = "button"
                      onclick = ws.send("xterm\040#started")>xterm </button>
    
            #!/bin/bash
            export DISPLAY=:0.0
            while read command
              do
                eval $command
              done
    
    更多详情: