<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - xdg-open doesn't honor $BROWSER in "generic" environment"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=59104">59104</a>
          </td>
        </tr>

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

        <tr>
          <th>Summary</th>
          <td>xdg-open doesn't honor $BROWSER in "generic" environment
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>goeran@uddeborg.se
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>1.1.0
          </td>
        </tr>

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

        <tr>
          <th>Product</th>
          <td>Portland
          </td>
        </tr></table>
      <p>
        <div>
        <pre>As I understand it, the intended way to choose the preferred browser in a
"generic" desktop environment is to set the environment variable $BROWSER.  But
when running xdg-open on a URL in such an environment, it will use whatever
browser comes first when searching for desktop files with
"x-scheme-handler/http" among the MimeType:s.  $BROWSER is only taken into
account if no such desktop file exists.

I would have thought the call to open_generic_xdg_x_scheme_handler() in
open_generic() in xdg-open ought to come AFTER the "for browser in $BROWSER"
loop.

When testing on my Fedora box with
xdg-utils-1.1.0-0.14.20120809git.fc18.noarch, if I open a URL with xdg-open, it
comes up in epiphany.  Both epiphany.desktop and firefox.desktop lists
"x-scheme-handler/http", and since "e" comes before "f", epiphany wins.  I have
$BROWSER set to "firefox", but that is apparently ignored.</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>