开发者

Raising X11 urgent flag from webbrowser

开发者 https://www.devze.com 2023-01-08 22:06 出处:网络
The global picture is that I want my Firefox X11 window to have its urgent flag set when (say) a new Gmail mail arrives.

The global picture is that I want my Firefox X11 window to have its urgent flag set when (say) a new Gmail mail arrives.

I feel confident that I can produce the code to check Gmails arrival by reading some other Firefox extensions' code. What I can't figure out is how to get the Window ID of the webbrowser, so that I can call, say, an external program to raise the urgent flag (that is, setting the XUrgencyHint).

Any help appreciated; if my methodology (i.e. create an extension) is no good, don't hesitate to say开发者_如何学运维 so.


While you did not mention your programming/scripting language you where planning to use to find firefox's window to set, I found this answer on SO to your exact question (both questions are essentially the same: find ff window in x11).

Generally spoken, in firefox each 'container of tabs' is a window and each tab is a window (hence you can load firefox ui inside firefox ui). So you could search for firefox windows with a specific title or src/url.

But.. since you are after a open gmail-tab in firefox anyway.. why not think inside the box instead of outside the box.. (I know, feels strange right :) ?) Why not craft a simple bookmarklet (called something like 'monitor new gmail') and add it to your bookmarks(-bar) (working around FaceFox's -yes I made this diss- insanity of not accepting web-standard javascript in the address-bar anymore..).
This bookmark should do:

  • make gmail check for new mail periodically (it'll be AJAX-like anyway),
  • detect new mail (by comparing the contents of the first row in the table that holds the mail-subjects or what ever you can hook)
  • and finally set window.getAttention() (for firefox)
    OR (a little more cross-browser:) change document-title OR alternate/change blinking/non-blinking favicon.. See this and this topic on SO for some simple and nifty scripts on doing this.
0

精彩评论

暂无评论...
验证码 换一张
取 消