Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
Maggew.com
31 discussion posts
May you please provide some wisdom? I would like run function when a FF Incognito / Private tab is opened (CTRL + SHFT + P).

How do I target the Private Tab that Firefox browser creates with DF triggers? For some reason, my below trigger doesn't work.

1. DF Settings
2. Triggers
3. Add

I've even tried playing around with the Window Text but have had no luck.
• Attachment: df-trigger-firefox.png [31,081 bytes]
df-trigger-firefox.png
df-trigger-firefox.png
• Attachment: firefox-private-browse.png [12,385 bytes]
firefox-private-browse.png
firefox-private-browse.png
Feb 13, 2018 (modified Feb 13, 2018)  • #1
warthurton's profile on WallpaperFusion.com
It looks like the window doesn't change the title text quick enough for DF Triggers to see it after it is created.

I created a trigger on the Window Class "MozillaWindowClass" and Window Created Always (see image attached)

Then I created a scripted function that checks the Title text for 5 seconds and runs it is it is Private.

Yes, it does this for every firefox window create but the overhead is low.

(Note that the less than sign keeps html escaping for some reason)

Code

using System;
using System.Drawing;

// The 'windowHandle' parameter will contain the window handle for the:
//   - Active window when run by hotkey
//   - Trigger target when run by a Trigger rule
//   - TitleBar Button owner when run by a TitleBar Button
//   - Jump List owner when run from a Taskbar Jump List
//   - Currently focused window if none of these match
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        string myTest = BFS.Window.GetText(windowHandle);

        int Interval = 0;
 // MAKE SURE THIS IS LESS THAN OR EQUAL.  THE FORUMS ARE CHANING WHAT I PASTE       
        while (Interval++ <= 10)   // MAKE SURE THIS IS LESS THAN OR EQUAL.  THE FORUMS ARE CHANING WHAT I PASTE
// MAKE SURE THIS IS LESS THAN OR EQUAL.  THE FORUMS ARE CHANING WHAT I PASTE
        {
            myTest = BFS.Window.GetText(windowHandle);
            if (myTest == "Private Browsing - Mozilla Firefox (Private Browsing)")
            {
                BFS.DisplayFusion.RunFunctionWithWindowHandle("Move Window to Center of Monitor and Size to 75%", windowHandle);
             
                return;
            }
            BFS.General.ThreadWait(500);
        }    
    }
}
• Attachment: sshot-2018-02-13-[13-19-13].png [43,398 bytes]
sshot-2018-02-13-[13-19-13].png
sshot-2018-02-13-[13-19-13].png
Feb 13, 2018 (modified Feb 14, 2018)  • #2
User Image
Maggew.com
31 discussion posts
You mentioned a > symbol, when I searched code I did not see that symbol.

Did you too receive this message? I copy / pasted your code into a new custom function and scripted function, no luck with either. Hmm.. I'm pretty sure I did everything correct.
• Attachment: df-scripted-function.png [46,315 bytes]
df-scripted-function.png
df-scripted-function.png
• Attachment: df-trigger-function-new-scripted.png [7,460 bytes]
df-trigger-function-new-scripted.png
df-trigger-function-new-scripted.png
Feb 14, 2018 (modified Feb 14, 2018)  • #3
warthurton's profile on WallpaperFusion.com
On line 18 change to <= instead of the junk character that kept pasting in.
Feb 14, 2018  • #4
User Image
Maggew.com
31 discussion posts
Thanks!!

Everything works just as you said it would.

I'm grateful for your wisdom, thanks again for sharing.
Feb 14, 2018 (modified Feb 14, 2018)  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
We've just released a new DisplayFusion beta version there's now a delay setting for the Match Conditions, so you can create a rule for Firefox, specify the Window Text, and add a 2 or 3 second delay for checking the Window Text. Please let us know if you run into any trouble after updating.

Thanks!
Apr 27, 2018  • #6
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(1)  Login to Vote(-)