forked from alice0775/userChrome.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patchForBug646374.uc.js
56 lines (51 loc) · 1.6 KB
/
patchForBug646374.uc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// ==UserScript==
// @name patchForBug646374.uc.js
// @namespace http://space.geocities.yahoo.co.jp/gl/alice0775
// @description Bug 646374 - Windows taskbar button order is altered when transitioning into full-screen mode
// @include main
// @compatibility Firefox 4.0+
// @author Alice0775
// @version 2013/01/25 05:00:00
// @version 2011/05/27 00:00:00
// ==/UserScript==
var bug646374 = {
init: function(){
window.BrowserFullScreen_org = window.BrowserFullScreen;
window.BrowserFullScreen = function() {
if (!window.fullScreen) {
if (window.windowState == 3) {
window.backupSizemode = "normal"
window.maximize();
setTimeout(function(){BrowserFullScreen_org();}, 0);
} else {
BrowserFullScreen_org();
window.backupSizemode = ""
}
} else {
BrowserFullScreen_org();
if (typeof window.backupSizemode != 'undefined' &&
window.backupSizemode == "normal") {
setTimeout(function(){
window.restore();
window.backupSizemode = ""
}, 0);
}
}
}
window.addEventListener("unload", this, false);
},
uninit: function() {
window.removeEventListener("unload", this, false);
window.BrowserFullScreen = window.BrowserFullScreen_org;
delete window.BrowserFullScreen_org;
if (typeof window.backupSizemode != "undefined")
delete window.backupSizemode;
},
handleEvent: function(event) {
switch (event,type) {
case "unload":
this.uninit();
}
}
}
bug646374.init();