-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch in browser per ini list #18
Comments
I have done some testing on this. You can get very close to a universal method for near all cases, including default and non-default browsers. I carry on working on that and see if I can describe a common path. |
Ok. I'm assigning you for at least the research stage. You know, I really need to get a cool avatar like you have. |
Jermolene made it for me. Thomas tweaked it. |
IF we use [wikis] to determine (sensible) what gets auto-started there IS a problem. Because we also let files like "C:\users\polly\note\my-estranged-beak.db" be recorded as wikis (for parroting). What happens with that on "Start-Process"? Perhaps all non-wiki files need go under [otherfiles]? |
Just launch .htm/.html files, perhaps? |
@Marxsal wanted to update you on where I got to ... BROWSER LAUNCH LOGIC & CODE There are several ways to open browsers and web pages in PowerShell.
A downside (inevitable) is we don't know how users will have configured their browsers. The method might open one instance of browser, or several. I might add a note in Docs about that. Though its not a Polly issue per se. The "Start-Process" method worked well, at least on Windows. As simple as (fingers crossed) ...
But needs testing on Linux / MacOS Another method (backwards compatible) I'm looked into would be to assemble a "raw command line" when "browser=something" is set. This would allow the user to ALSO specify more details in the command ...
activated via ...
That needs more work & research. And vocal demand from the 2.5 users :-)
Okay. Best in filter in run-loop? Let me know if this makes sense & is helpful. TT |
That works as long as the uri goes at the end. Does it with all browsers? |
Unless the poor little loop's logic becomes impossible to follow, in which case we put everything in it's own function, possible in a separate library file.
Yes, it is. But it's going to need to be refined. If there's no defined browser on linux, then I think we have to check for a browser. There's a default browser link, x-www.browser which works in debian/ubuntu. We can check for it's existence (I think). If it exists, we can launch. If not, we have to say "Sorry Dave, I can't do that" or something. Checking for the existence of software on Linux is done via the "which" command. All the Linux commands appear to work in PS, as long as they don't conflict with PS aliases. What I don't know is how to fetch and use the results of a command like
TIL that Linux thinks my default browser is Chrome. I didn't even know I had chrome on the machine. |
After consultation, I think we're going to need linux users to tell us what browser they use. We can recommend they look up the name from their desktop or application launcher. The name may not be intuitive unless they look it up from their desktop. For instance, "chrome" isn't "chrome", it's "google-chromium-stable". |
On Windows the process of launch was easy once you hone it and I derived a good method, I think. The Linux thing, well, its practically out of my possibility. |
Yes. That "&" initiation was experimental but works. The MAIN issue on Windows is launching of browsers by exe address DIFFERS from DEFAULT activation. Default activation is conservative & minimal. Follow its rules and all browsers work. |
I'm beginning to grasp Linux has no defaults?? Right? |
Okay (groan). I tried to find info on capturing "which" output on PS6, but there is scarce info as yet on o/s variants. Perhaps it needs to be piped into capture? "Which" does have output. |
Rethinking. Maybe for Linux, and by extension, Mac, users, we can just create a starter settings.ini with lots of embedded comments. Linux people tend to have lots of experience with tweaking settings. Unless you bought a machine with Linux already on it, you probably had to do a fair amount of tweaking just to get where you are. And we don't even know if Mac users are going to be receptive to PS. |
Okay. That reinforces idea that actually there is a "setup" process on first use. Would you want to add an item for "editor =" ? |
Yes, that would make sense. Most die-hard Linux fans are also veterans of the great Emacs/Vi wars, and can tell 15 you different reasons their choice is best. Forty years on, and the scars remain. It looks like Mac does have a standard (TextEdit) text editor built-in, so you could insert that automatically for $isMacOs (after finding out how to invoke it). |
It should be relatively easy to do mildly differing setup process by platform. I got the logic laid out formally. It will take some days yet to code it. As soon as I have a workable test I'll let you know. I'm very aware it needs early testing on Linux. |
The problem is that there is likely no universal, reliable way to launch using any browser other than the default browser (which may not be the browser and profile that the user regularly wants).
The text was updated successfully, but these errors were encountered: