Lines 33-38
Link Here
|
33 |
|
33 |
|
34 |
import org.w3c.dom.Document; |
34 |
import org.w3c.dom.Document; |
35 |
import org.w3c.dom.Node; |
35 |
import org.w3c.dom.Node; |
|
|
36 |
import org.w3c.dom.Location; |
36 |
|
37 |
|
37 |
/** |
38 |
/** |
38 |
* This class wraps a Window object to expose it to the interpreter. |
39 |
* This class wraps a Window object to expose it to the interpreter. |
Lines 66-71
Link Here
|
66 |
"postURL", "alert", "confirm", "prompt" }; |
67 |
"postURL", "alert", "confirm", "prompt" }; |
67 |
this.defineFunctionProperties(names, WindowWrapper.class, |
68 |
this.defineFunctionProperties(names, WindowWrapper.class, |
68 |
ScriptableObject.DONTENUM); |
69 |
ScriptableObject.DONTENUM); |
|
|
70 |
this.defineProperty("location", WindowWrapper.class, |
71 |
ScriptableObject.PERMANENT); |
69 |
} |
72 |
} |
70 |
|
73 |
|
71 |
public String getClassName() { |
74 |
public String getClassName() { |
Lines 188-194
Link Here
|
188 |
|
191 |
|
189 |
Object ret; |
192 |
Object ret; |
190 |
// If acc is null we are running in an Applet (or some other |
193 |
// If acc is null we are running in an Applet (or some other |
191 |
// restrictive environment) so don't sweat security it's |
194 |
// restrictive environment) so don't sweat security it's |
192 |
// the "Browsers" problem... |
195 |
// the "Browsers" problem... |
193 |
if (acc != null) ret = AccessController.doPrivileged(pa , acc); |
196 |
if (acc != null) ret = AccessController.doPrivileged(pa , acc); |
194 |
else ret = AccessController.doPrivileged(pa); |
197 |
else ret = AccessController.doPrivileged(pa); |
Lines 406-411
Link Here
|
406 |
} |
409 |
} |
407 |
|
410 |
|
408 |
/** |
411 |
/** |
|
|
412 |
* Return the Location for this Window. |
413 |
*/ |
414 |
public Location getLocation() { |
415 |
return window.getLocation(); |
416 |
} |
417 |
|
418 |
/** |
419 |
* Return the Location for this Window. |
420 |
*/ |
421 |
public void setLocation(Object val) { |
422 |
String url = (String)Context.jsToJava(val, String.class); |
423 |
window.getLocation().assign(url); |
424 |
} |
425 |
|
426 |
/** |
409 |
* To wrap a function in an handler. |
427 |
* To wrap a function in an handler. |
410 |
*/ |
428 |
*/ |
411 |
protected static class FunctionWrapper implements Runnable { |
429 |
protected static class FunctionWrapper implements Runnable { |