Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 101244 Details for
Bug 161864
Provide API to disable potentially dangerous content in Browser
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
proposed fix
patch.txt (text/plain), 4.71 KB, created by
Jacek Pospychala
on 2008-05-21 09:04:33 EDT
(
hide
)
Description:
proposed fix
Filename:
MIME Type:
Creator:
Jacek Pospychala
Created:
2008-05-21 09:04:33 EDT
Size:
4.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.swt >Index: Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java,v >retrieving revision 1.104 >diff -u -r1.104 Mozilla.java >--- Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java 16 May 2008 13:56:42 -0000 1.104 >+++ Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java 21 May 2008 12:49:07 -0000 >@@ -3179,4 +3179,8 @@ > } > return XPCOM.NS_OK; > } >+ >+public void setJavascriptEnabled(boolean enabled) { >+ SWT.error(SWT.ERROR_NOT_IMPLEMENTED); >+} > } >Index: Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java,v >retrieving revision 1.41 >diff -u -r1.41 WebSite.java >--- Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java 6 May 2008 19:25:13 -0000 1.41 >+++ Eclipse SWT Browser/win32/org/eclipse/swt/browser/WebSite.java 21 May 2008 12:49:06 -0000 >@@ -24,6 +24,7 @@ > COMObject iInternetSecurityManager; > COMObject iOleCommandTarget; > boolean ignoreNextMessage; >+ boolean javascriptEnabled = false; > > static final int OLECMDID_SHOWSCRIPTERROR = 40; > static final short [] ACCENTS = new short [] {'~', '`', '\'', '^', '"'}; >@@ -456,6 +457,12 @@ > */ > int policy = IE.URLPOLICY_ALLOW; > /* >+ * Don't allow Javascript if it's disabled. >+ */ >+ if (dwAction == 5120 /*0x1400 - URLACTION_SCRIPT_RUN*/ && !javascriptEnabled) { >+ policy = IE.URLPOLICY_DISALLOW; >+ } >+ /* > * The URLACTION_JAVA flags refer to the <applet> tag, which resolves to > * the Microsoft VM if the applet is java 1.1.x compliant, or to the OS's > * java plug-in VM otherwise. Applets launched with the MS VM work in the >Index: Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java,v >retrieving revision 1.28 >diff -u -r1.28 IE.java >--- Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java 9 May 2008 21:26:14 -0000 1.28 >+++ Eclipse SWT Browser/win32/org/eclipse/swt/browser/IE.java 21 May 2008 12:49:06 -0000 >@@ -20,7 +20,7 @@ > class IE extends WebBrowser { > > OleFrame frame; >- OleControlSite site; >+ WebSite site; > OleAutomation auto; > OleListener domListener; > OleAutomation[] documents = new OleAutomation[0]; >@@ -923,6 +923,10 @@ > auto.invoke(rgdispid[0]); > } > >+public void setJavascriptEnabled(boolean enabled) { >+ site.javascriptEnabled = enabled; >+} >+ > void handleDOMEvent (OleEvent e) { > if (e.arguments == null || e.arguments.length == 0) return; /* for IE5 */ > >@@ -1313,4 +1317,5 @@ > } > } > } >+ > } >Index: Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java,v >retrieving revision 1.7 >diff -u -r1.7 WebBrowser.java >--- Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java 23 Jan 2008 14:24:33 -0000 1.7 >+++ Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java 21 May 2008 12:49:06 -0000 >@@ -392,6 +392,8 @@ > > public abstract void stop (); > >+public abstract void setJavascriptEnabled(boolean enabled); >+ > int translateKey (int key) { > for (int i = 0; i < KeyTable.length; i++) { > if (KeyTable[i][0] == key) return KeyTable[i][1]; >Index: Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java,v >retrieving revision 1.20 >diff -u -r1.20 Browser.java >--- Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java 3 Jan 2008 15:04:55 -0000 1.20 >+++ Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java 21 May 2008 12:49:05 -0000 >@@ -760,6 +760,22 @@ > } > > /** >+ * Enable javascript. >+ * >+ * @exception SWTException <ul> >+ * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li> >+ * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> >+ * </ul> >+ * >+ * @param enabled the new Javascript enablement state >+ */ >+public void setJavascriptEnabled(boolean enabled) { >+ checkWidget(); >+ webBrowser.setJavascriptEnabled(enabled); >+ >+} >+ >+/** > * Stop any loading and rendering activity. > * > * @exception SWTException <ul>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 161864
:
99921
| 101244