Opening Links from Applications in Background?

Discussions for the Apple Mac OS builds of Pale Moon

Moderator: dbsoft

Forum rules
Important note:
The old Mac OS versions of Pale Moon were provided by various people and not official or in any way organized. Please make sure you check the date of topic threads to know if the topic is current or relevant! We are using this board for both old discussions and new development of Pale Moon on Mac.

Any specific bugs you find that don't have their own topic yet: please make a new topic; one bug per topic please to keep things organized.
Jazoray

Opening Links from Applications in Background?

Unread post by Jazoray » 2015-07-31, 08:13

I have an application other than Pale Moon that has a link. I click on it, and the browser opens the link in a new Tab

On windows, the browser window is not focused or raised when this happens. That's the way i like it.

On mac, the browser window is focused and raised when this happens. i feel violated.

Is this behavior controlled by the browser or by the OS?

What can i do on OSX to not make PM steal focus when it opens a link from an Application?

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Opening Links from Applications in Background?

Unread post by ketmar » 2015-07-31, 12:56

i believe that PM tries to gain focus on windows too, but windows prevents "focus stealing". judging from source code, PM always trying to focus it's window, regardless of OS.

maybe setting "browser.tabs.loadDivertedInBackground" to true may help, but i didn't checked what exactly it does in PM.

Jazoray

Re: Opening Links from Applications in Background?

Unread post by Jazoray » 2015-07-31, 15:47

ketmar wrote: maybe setting "browser.tabs.loadDivertedInBackground" to true may help, but i didn't checked what exactly it does in PM.
it's already set to true. so i don't think it does what you think it does.

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Opening Links from Applications in Background?

Unread post by ketmar » 2015-07-31, 15:53

seems that you are right. but, do "palemoon -new-tab <url>" still activates PM window?

Jazoray

Re: Opening Links from Applications in Background?

Unread post by Jazoray » 2015-07-31, 16:10

ketmar wrote:seems that you are right. but, do "palemoon -new-tab <url>" still activates PM window?
how do i do that?

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Opening Links from Applications in Background?

Unread post by ketmar » 2015-07-31, 16:17

i'm not familiar with OS X, but there should be terminal app with command prompt. if you type "palemoon -new-tab http://google.com" in command promt, does it still brings PM window to foreground? if not, than you should somehow change the preference OS X is using to exec a browser when you clicking on link, adding "-new-tab" there. sorry, i don't know how to do that.

Jazoray

Re: Opening Links from Applications in Background?

Unread post by Jazoray » 2015-07-31, 16:33

ketmar wrote:i'm not familiar with OS X, but there should be terminal app with command prompt. if you type "palemoon -new-tab http://google.com" in command promt, does it still brings PM window to foreground? if not, than you should somehow change the preference OS X is using to exec a browser when you clicking on link, adding "-new-tab" there. sorry, i don't know how to do that.

yes there is a terminal app with a command prompt. it has a command for launching Apps or opening a file (or URI) with a specific app.

that command is open
the syntax is
open [URI] -a NewMoon
the -a Flag tells open which app is supposed to be used opening that URI or file.

apparently, there is [ --args arguments] at the end of the command so the proper command should be

Code: Select all

 open http://www.google.com -a NewMoon --args -new-tab
but there is no difference wether or not i use the --args flag because my palemoon is set up to always open links from other applications in a new tab. so i can't tell if the --args switch is even used


however, open also has a -g switch, that opens the specified app in the background.

so the command for opening a link in pale moon in background is

Code: Select all

open http://www.google.com -ga newmoon
But this won't help me, because there is no way clicking a link in another application triggers that command. unless i can develop an application that advertises itself to the operating system as a browser (so i can set it as default browser) that accepts the link i clicked on in the other app and silently executes above command replacing http://www.google.com with the url i clicked.

User avatar
ketmar
Lunatic
Lunatic
Posts: 369
Joined: 2015-07-28, 11:10
Location: Earth

Re: Opening Links from Applications in Background?

Unread post by ketmar » 2015-07-31, 16:39

alas, that was all i can do for that case. sorry for the noise, and let's wait for some OS X guru. ;-)

HarmonicResonance

Re: Opening Links from Applications in Background?

Unread post by HarmonicResonance » 2015-08-02, 20:38

Seems like you have a feature request - to provide the ability to open tabs in the background. Judging by the command-line options, PM has this ability already. It would just need some UI work to provide an option to the user, which if checked, would force -ga into the call that PM makes when it sees a URL. This may not be technically 100%, but basically that's what you want right?

Jazoray

Re: Opening Links from Applications in Background?

Unread post by Jazoray » 2015-08-02, 21:25

HarmonicResonance wrote:Seems like you have a feature request - to provide the ability to open tabs in the background. Judging by the command-line options, PM has this ability already. It would just need some UI work to provide an option to the user, which if checked, would force -ga into the call that PM makes when it sees a URL. This may not be technically 100%, but basically that's what you want right?
Pale moon does have the ability to open links in background. That's how it behaves on Windows. So this is more a porting request than a feature request.

But I wonder if this can be done at all on osx. On Windows, every Window is responsible for its own focusing and raising. This might be the same on osx, but on every day use, it seems to me that focusing lies more in the responsibility of the OS itself. But that is just feeling and guessing.
Even if we can solve my problem within pm, the -g switch cannot be part of the solution when we solve the problem in the browser.
Because once the browser becomes active, the command toopen the url is already over. There is then no opportunity left to squeeze the -g switch in there. Other than time travel.

The open command is not something that pale moon calls when it's asked to open an url.
Open is a command line program that the user can type to open a file with the default app or a specific app. And it has the -g switch for opening the app in background