View | Details | Raw Unified | Return to bug 161864 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java (+4 lines)
Lines 3179-3182 Link Here
3179
	}
3179
	}
3180
	return XPCOM.NS_OK;
3180
	return XPCOM.NS_OK;
3181
}
3181
}
3182
3183
public void setJavascriptEnabled(boolean enabled) {
3184
	SWT.error(SWT.ERROR_NOT_IMPLEMENTED);
3185
}
3182
}
3186
}
(-)Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java (+7 lines)
Lines 24-29 Link Here
24
	COMObject iInternetSecurityManager;
24
	COMObject iInternetSecurityManager;
25
	COMObject iOleCommandTarget;
25
	COMObject iOleCommandTarget;
26
	boolean ignoreNextMessage;
26
	boolean ignoreNextMessage;
27
	boolean javascriptEnabled = false;
27
28
28
	static final int OLECMDID_SHOWSCRIPTERROR = 40;
29
	static final int OLECMDID_SHOWSCRIPTERROR = 40;
29
	static final short [] ACCENTS = new short [] {'~', '`', '\'', '^', '"'};
30
	static final short [] ACCENTS = new short [] {'~', '`', '\'', '^', '"'};
Lines 456-461 Link Here
456
	*/
457
	*/
457
	int policy = IE.URLPOLICY_ALLOW;
458
	int policy = IE.URLPOLICY_ALLOW;
458
	/*
459
	/*
460
	 * Don't allow Javascript if it's disabled.
461
	 */
462
	if (dwAction == 5120 /*0x1400 - URLACTION_SCRIPT_RUN*/ && !javascriptEnabled) {
463
	    policy = IE.URLPOLICY_DISALLOW;
464
	}
465
	/*
459
	* The URLACTION_JAVA flags refer to the <applet> tag, which resolves to
466
	* The URLACTION_JAVA flags refer to the <applet> tag, which resolves to
460
	* the Microsoft VM if the applet is java 1.1.x compliant, or to the OS's
467
	* the Microsoft VM if the applet is java 1.1.x compliant, or to the OS's
461
	* java plug-in VM otherwise.  Applets launched with the MS VM work in the
468
	* java plug-in VM otherwise.  Applets launched with the MS VM work in the
(-)Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java (-1 / +6 lines)
Lines 20-26 Link Here
20
class IE extends WebBrowser {
20
class IE extends WebBrowser {
21
21
22
	OleFrame frame;
22
	OleFrame frame;
23
	OleControlSite site;
23
	WebSite site;
24
	OleAutomation auto;
24
	OleAutomation auto;
25
	OleListener domListener;
25
	OleListener domListener;
26
	OleAutomation[] documents = new OleAutomation[0];
26
	OleAutomation[] documents = new OleAutomation[0];
Lines 923-928 Link Here
923
	auto.invoke(rgdispid[0]);
923
	auto.invoke(rgdispid[0]);
924
}
924
}
925
925
926
public void setJavascriptEnabled(boolean enabled) {
927
	site.javascriptEnabled = enabled;
928
}
929
926
void handleDOMEvent (OleEvent e) {
930
void handleDOMEvent (OleEvent e) {
927
	if (e.arguments == null || e.arguments.length == 0) return; /* for IE5 */
931
	if (e.arguments == null || e.arguments.length == 0) return; /* for IE5 */
928
932
Lines 1313-1316 Link Here
1313
		}
1317
		}
1314
	}
1318
	}
1315
}
1319
}
1320
1316
}
1321
}
(-)Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java (+2 lines)
Lines 392-397 Link Here
392
392
393
public abstract void stop ();
393
public abstract void stop ();
394
394
395
public abstract void setJavascriptEnabled(boolean enabled);
396
395
int translateKey (int key) {
397
int translateKey (int key) {
396
	for (int i = 0; i < KeyTable.length; i++) {
398
	for (int i = 0; i < KeyTable.length; i++) {
397
		if (KeyTable[i][0] == key) return KeyTable[i][1];
399
		if (KeyTable[i][0] == key) return KeyTable[i][1];
(-)Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java (+16 lines)
Lines 760-765 Link Here
760
}
760
}
761
761
762
/**
762
/**
763
 * Enable javascript.
764
 * 
765
 * @exception SWTException <ul>
766
 *    <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
767
 *    <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
768
 * </ul>
769
 * 
770
 * @param enabled the new Javascript enablement state
771
 */
772
public void setJavascriptEnabled(boolean enabled) {
773
	checkWidget();
774
	webBrowser.setJavascriptEnabled(enabled);
775
	
776
}
777
778
/**
763
 * Stop any loading and rendering activity.
779
 * Stop any loading and rendering activity.
764
 *
780
 *
765
 * @exception SWTException <ul>
781
 * @exception SWTException <ul>

Return to bug 161864