Skip to content

Instantly share code, notes, and snippets.

@davidtheclark
Last active August 29, 2015 14:15
Show Gist options
  • Save davidtheclark/f0443e93caf25bffe497 to your computer and use it in GitHub Desktop.
Save davidtheclark/f0443e93caf25bffe497 to your computer and use it in GitHub Desktop.
available browser info module idea

There are several modules that do the following:

  1. locate available browsers on the current machine;
  2. do something with that information.

Usually #2 is "launch the browser with some specific content", but not always.

The modules I have in mind (of course there may be more!) are:

What I noticed is that each of these modules hosts a similar set of information about how to find browsers and parse versions on different platforms. See:

That means that each of them has to maintain their information sets independently. Meanwhile, if another module comes along that wants to do something different with available local browsers, it will have to reproduce the information set in its own way.

I wonder if that information set could be pooled into a shared module? Everybody would get the accurate info; if a bug like "Doesn't find Firefox on Windows..." is fixed in the shared module, everybody benefits; and new modules could use it to whatever ends they want.

If not sure if the module should just be an object of information or if it should also have some functionality. Seems plausible to me that each plugin would want to independently control how it uses the information to actually find (and probably run) the browser (?).

At least one problem: I have no idea how to make automated test this kind of thing.

@davidtheclark
Copy link
Author

Started work here https://github.com/davidtheclark/locate-browsers — along with its supporting browser-specific modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment