will-stone / browserosaurus

🦖 The browser prompter for macOS
https://browserosaurus.com
GNU General Public License v3.0
1.72k stars 161 forks source link

Version 8.1.1 listing nonexistent browser app? #154

Closed i0ntempest closed 5 years ago

i0ntempest commented 5 years ago

Describe the bug Version 8.1.1 of the app found "qutebrowser" on my system, which was never installed.

To Reproduce Steps to reproduce the behaviour:

  1. Click on a link, the window shows qutebrowser along with other browsers I have.
  2. Click on qutebrowser, window disappears, nothing happens, because I've never installed that browser.

Expected behaviour That browser should not be in the browser chooser window.

Screenshots

image

Three browsers at the top are dimmed because I was holding Alt when taking screenshot.

Desktop (please complete the following information):

Additional context This problem does not occur on 10.15.1. Error messages when running the app binary from the terminal:

LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier org.qt-project.Qt.QtWebEngineCore.

    at w (/Applications/Browserosaurus.app/Contents/Resources/app.asar/.webpack/main/index.js:1:54859)
    at /Applications/Browserosaurus.app/Contents/Resources/app.asar/.webpack/main/index.js:1:55896
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:9076) UnhandledPromiseRejectionWarning: Error: Command failed: sh -c open "https://diverse.direct/order/" -b org.qt-project.Qt.QtWebEngineCore
LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier org.qt-project.Qt.QtWebEngineCore.

    at w (/Applications/Browserosaurus.app/Contents/Resources/app.asar/.webpack/main/index.js:1:54859)
    at /Applications/Browserosaurus.app/Contents/Resources/app.asar/.webpack/main/index.js:1:55896
    at processTicksAndRejections (internal/process/task_queues.js:85:5)
(node:9076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9076) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9076) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:9076) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
will-stone commented 5 years ago

Thanks for all the info. You say it doesn’t occur on macOS 10.15.1. I unfortunately can only support the latest version of macOS. I will make that more clear on the website and README. If you’d like to take a look at the code and submit a PR, I will be more than happy to review it.

i0ntempest commented 5 years ago

Okay then... Is it possible to get logs when the app is starting up, so I can know where and why it "finds" that browser?

will-stone commented 5 years ago

Sure. Download the project, edit this function to log out the appPath, then run yarn list-browsers.

richardbrockie commented 5 years ago

I'm here to report the same thing. Just updated to 8.1.1 from 8.0.1 on macOS 10.14.6 on 2 machines.

With 8.1.1 I'm also seeing qutebrowser listed in error in addition to those browsers already installed on the system. I did not see this with 8.0.1.

One machine is IT maintained and will not move to Catalina for a couple of months until verification is complete.

will-stone commented 5 years ago

One machine is IT maintained and will not move to Catalina for a couple of months until verification is complete.

Interesting. Maybe it shouldn't have random software installed on it, made by some internet loon 😏

Seriously though, the app is free, I maintain this in my spare time and cannot afford to keep macs around on old versions of macOS just for regression testing. If you'd like to run the command mentioned above, it will give me more info, but officially the project will only support the version of macOS that I'm currently using 😄

richardbrockie commented 5 years ago

One machine is IT maintained and will not move to Catalina for a couple of months until verification is complete.

Interesting. Maybe it shouldn't have random software installed on it, made by some internet loon 😏

Seriously though, the app is free, I maintain this in my spare time and cannot afford to keep macs around on old versions of macOS just for regression testing. If you'd like to run the command mentioned above, it will give me more info, but officially the project will only support the version of macOS that I'm currently using 😄

Understood!

I've tried to run the command you suggest, but it didn't work the first time. Before making any attempt at logging, here is what I had to install - am I on the correct lines?

$ brew install yarn
$ npm install ts-node
$ npm install tslib

I'm in the root of the project:

$ pwd
<snip>/browserosaurus/browserosaurus-master

Now I run the command:


$ yarn list-browsers
yarn run v1.19.1
$ ts-node ./scripts/listInstalledBrowsers

/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:245
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
src/utils/getInstalledBrowsers.ts:1:22 - error TS2307: Cannot find module 'child_process'.

1 import { exec } from 'child_process'
                       ~~~~~~~~~~~~~~~
src/utils/getInstalledBrowsers.ts:2:27 - error TS2307: Cannot find module 'util'.

2 import { promisify } from 'util'
                            ~~~~~~

    at createTSError (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:245:12)
    at reportTSError (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:249:19)
    at getOutput (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:357:34)
    at Object.compile (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:415:32)
    at Module.m._compile (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:493:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Object.require.extensions.<computed> [as .ts] (/<snip>/browserosaurus/browserosaurus-master/node_modules/ts-node/src/index.ts:496:12)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.```
will-stone commented 5 years ago

@richardbrockie Nearly. Either git clone or download the project and unzip it. cd into the folder. Run yarn to install the dependencies then yarn list-browsers (once you've altered the file to log out the path).

richardbrockie commented 5 years ago

Thanks - I'm a newbie to yarn. Looks to me like qt being installed in brew is being interpreted as having qutebrowser installed. Here's the output:

$ yarn list-browsers
yarn run v1.19.1
$ ts-node ./scripts/listInstalledBrowsers
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath: /Applications/Firefox.app

getInstalledBrowsers: appPath: /Applications/Google Chrome.app

getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath: /usr/local/Cellar/qt/5.13.2/lib/QtWebEngineCore.framework

getInstalledBrowsers: appPath: /Applications/Safari.app

getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
getInstalledBrowsers: appPath:
[ 'Firefox', 'Google Chrome', 'qutebrowser', 'Safari' ]
✨  Done in 2.37s.
i0ntempest commented 5 years ago

Same here, except the path is /Users/Admin/Library/Application Support/Origin/SelfUpdate/Staged/Contents/Frameworks/QtWebEngineCore.framework, something in the staged Origin app. A change in that mfind command to exclude all .framework bundles can solve the problem. I'll make a PR some time.

i0ntempest commented 5 years ago

PR created. I added kMDItemContentType == "com.apple.application-bundle" so it finds app bundles only.

richardbrockie commented 5 years ago

Confirming correct operation in v8.1.2 - many thanks!