<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - xdg-open: prioritizes xdg_mime over $BROWSER"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=105734">105734</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>xdg-open: prioritizes xdg_mime over $BROWSER
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Portland
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>xdg-utils
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>portland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>marco@sirabella.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=138345" name="attach_138345" title="fix">attachment 138345</a> <a href="attachment.cgi?id=138345&action=edit" title="fix">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=105734&attachment=138345'>[review]</a>
fix

Even if $BROWSER is set, still prioritizes `xdg-mime query default
x-scheme-handler/<schemetype>`.

Version: 
```
$ xdg-open --version
xdg-open 1.1.2
```

Steps to Reproduce:

```
$ BROWSER=echo xdg-open "<a href="https://bugs.freedesktop.org/">https://bugs.freedesktop.org/</a>"
```

Actual Behavior:
opens given URL in default web browser (mine is firefox)

Expected Behavior:
run $BROWSER <url>, in this case `echo <a href="https://bugs.freedesktop.org/">https://bugs.freedesktop.org/</a>`

if $BROWSER not found, fallback to xdg-mime defaults


I've found a hackish workaround for the time being:

```
$ DISPLAY="" BROWSER=echo xdg-open "<a href="https://bugs.freedesktop.org/">https://bugs.freedesktop.org/</a>"
<a href="https://bugs.freedesktop.org/">https://bugs.freedesktop.org/</a>
```

I'm attaching a patch for the reordering of priorities to fix this

Thanks,
-- Marco Sirabella</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>