如何使整个 Firefox 窗口透明?

如何使整个 Firefox 窗口透明?

我正在寻找一个 Firefox 附加组件或解决方案,可以使整个 Firefox 窗口变得透明。

最好是可以调整透明度并且有热键来快速启用或禁用该附加组件。

任何想法?

答案1

电源菜单:http://www.abstractpath.com/powermenu/会做你想做的事。

这里还有一些替代方案:http://alternativeto.net/software/powermenu/

答案2

接受的PowerMenu应用程序对我来说不起作用。但是,How-To Geek 通过 AutoHotkey 提供了很好的解决方案。只需安装 AutoHotkey 并将此脚本另存为.ahk并执行它。然后,您可以通过按住 Win/Meta 键并滚动鼠标滚轮来控制任何窗口的透明度。当然,这可以通过编辑脚本来调整。这在我尝试过的 Windows 7 x64 下的每个窗口上都有效。

; changing window transparencies
#WheelUp::  ; Increments transparency up by 3.375% (with wrap-around)
    DetectHiddenWindows, on
   WinGet, curtrans, Transparent, A
    if ! curtrans
        curtrans = 255
    newtrans := curtrans + 8
    if newtrans > 0
    {
        WinSet, Transparent, %newtrans%, A
    }
    else
    {
        WinSet, Transparent, OFF, A
        WinSet, Transparent, 255, A
    }
return

#WheelDown::  ; Increments transparency down by 3.375% (with wrap-around)
    DetectHiddenWindows, on
    WinGet, curtrans, Transparent, A
    if ! curtrans
        curtrans = 255
    newtrans := curtrans - 8
    if newtrans > 0
    {
        WinSet, Transparent, %newtrans%, A
    }
    ;else
    ;{
    ;    WinSet, Transparent, 255, A
    ;    WinSet, Transparent, OFF, A
    ;}
return

#o::  ; Reset Transparency Settings
    WinSet, Transparent, 255, A
    WinSet, Transparent, OFF, A
return

#g::  ; Press Win+G to show the current settings of the window under the mouse.
    MouseGetPos,,, MouseWin
    WinGet, Transparent, Transparent, ahk_id %MouseWin%
    ToolTip Translucency:`t%Transparent%`n
    Sleep 2000
    ToolTip
return

来源:howtogeek.com

答案3

修改版 AHK v1代码对于 AHK v2

  • 使用Ctrl+ Shift+Wheel Up/Down键来增加/减少应用程序或窗口的透明度。
  • MouseGetPos根据个人喜好使用来获取窗口 ID。
  • 500ms 工具提示

F8按下时显示具有预定义透明度值的弹出菜单(灵感来自代码)

#Requires AutoHotkey v2.0

^+WheelUp:: {           ; increases Trans value, makes the window more opaque
MouseGetPos ,, &WinID
; WinID := WinExist("A")  ; alternative - but 'Active' window might not always be the intended target
Trans := GetTrans(WinID)
If Trans < 255
    Trans := Trans + 20 ; add 20, change for slower/faster transition
If Trans >= 255
    Trans := "Off"
SetTransByWheel(Trans, WinID)
}

^+WheelDown:: {         ; decreases Trans value, makes the window more transparent
MouseGetPos ,, &WinID
Trans := GetTrans(WinID)
If Trans > 20
    Trans := Trans - 20 ; subtract 20, change for slower/faster transition
Else If Trans <= 20
    Trans := 1          ; never set to zero, causes ERROR
SetTransByWheel(Trans, WinID)
}

F8::SetTransMenuFn

;--------

GetTrans(id) {
Trans := WinGetTransparent("ahk_id " id)
If not Trans
    Trans := 255
Return Trans
}

;--------

SetTransByWheel(Transparency, id) {
If Transparency = "Off"
    WinSetTransparent 255, "ahk_id " id
    ; Set transparency to 255 before using Off - might avoid window redrawing problems such as a black background. If the window still fails to be redrawn correctly, try WinRedraw, WinMove or WinHide + WinShow for a possible workaround.
WinSetTransparent Transparency, "ahk_id " id
ToolTipFn("Transparency: " Transparency, -500)
}

;--------

SetTransMenuFn() {
MouseGetPos ,, &WinID   ; identify window id
; WinID := WinExist("A")  ; alternative - but 'Active' window might not always be the intended target
Global WinID            ; so that SetTransByMenu can use it to set transparency
SetTransMenu := Menu()
SetTransMenu.Delete
SetTransMenu.Add("&1 255 Opaque"            ,SetTransByMenu)
SetTransMenu.Add("&2 190 Translucent"       ,SetTransByMenu) ; Semi-opaque
SetTransMenu.Add("&3 125 Semi-transparent"  ,SetTransByMenu)
SetTransMenu.Add("&4  65 Nearly Invisible"  ,SetTransByMenu)
SetTransMenu.Add("&5   1 Invisible"         ,SetTransByMenu) ; never set to zero, causes ERROR
SetTransMenu.Show
}

;--------

SetTransByMenu(item, position, SetTransMenu) {
Transparency := Trim(SubStr(item, 4, 3))
WinSetTransparent Transparency, "ahk_id " WinID
If Transparency = 255 {
    WinSetTransparent "Off", "ahk_id " WinID ; Specifying Off - may improve performance and reduce usage of system resources
    }
ToolTipFn("Transparency: " Trim(SubStr(item, 4)), -2000)
}

;--------

ToolTipFn(mytext, myduration) {
ToolTip ; turn off any previous tooltip
ToolTip mytext
SetTimer () => ToolTip(), myduration
}

相关内容