This repository was archived by the owner on Jan 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathprogressListener.js
More file actions
79 lines (65 loc) · 2.73 KB
/
Copy pathprogressListener.js
File metadata and controls
79 lines (65 loc) · 2.73 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/*
Copyright 2007 Security Compass
This file is part of SQL Inject Me.
SQL Inject Me is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SQL Inject Me is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SQL Inject Me. If not, see <http://www.gnu.org/licenses/>.
If you have any questions regarding SQL Inject Me please contact
tools@securitycompass.com
*/
const STATE_START = Components.interfaces.nsIWebProgressListener.STATE_START;
const STATE_STOP = Components.interfaces.nsIWebProgressListener.STATE_STOP;
const STATE_IS_WINDOW = Components.interfaces.nsIWebProgressListener.STATE_IS_WINDOW;
const STATE_IS_DOCUMENT = Components.interfaces.nsIWebProgressListener.STATE_IS_DOCUMENT;
const LISTEN_ON_WINDOW = 1;
const LISTEN_ON_DOCUMENT = 2;
function sqlimeProgressListener(funcToCall, listenOn) {
this.func = funcToCall
this.listenOn = listenOn != null ? listenOn : STATE_IS_WINDOW;
dump('created a listener... mode is ' + listenOn + '\n');
this.interfaceName = "nsIWebProgressListener";
};
sqlimeProgressListener.prototype =
{
QueryInterface: function(aIID)
{
if (aIID.equals(Components.interfaces.nsIWebProgressListener) ||
aIID.equals(Components.interfaces.nsISupportsWeakReference) ||
aIID.equals(Components.interfaces.nsISupports))
{
return this;
}
throw Components.results.NS_NOINTERFACE;
return null;
},
onStateChange: function(aProgress, aRequest, aFlag, aStatus)
{
dump('got a state change. aFlag is ' + aFlag.toString(16) + '\n');
dump('got a state change. we are listening on ' +
this.listenOn.toString(16) + '\n');
// Components sometimes seems to disappear or or malfunction so we're
// just using the literal constant here.
// if((aFlag & 0x00000010) &&
// (aFlag & 0x00080000) )
if ((aFlag & STATE_STOP) && (aFlag & this.listenOn)) {
this.func();
}
return 0;
},
onLocationChange: function(aProgress, aRequest, aURI)
{
return 0;
},
// For definitions of the remaining functions see XULPlanet.com
onProgressChange: function() {return 0;},
onStatusChange: function() {return 0;},
onSecurityChange: function() {return 0;},
onLinkIconAvailable: function() {return 0;}
};