Skip to content

Commit 16e3c61

Browse files
committed
Remove ActiveX Scripting for Internet Explorer
1 parent 1311c41 commit 16e3c61

21 files changed

+4
-896
lines changed

AutoDuck/pywin32.mak

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ HTML_FILES = $(WIN32_HELP_DIR)\*.html \
2727
$(WIN32COM_DIR)/HTML/*.html \
2828
$(WIN32COM_DIR)/HTML/image/* \
2929
$(WIN32COM_HELP_DIR)/*.htm* \
30-
$(WIN32COMEXT_DIR)/axscript/demos/client/ie/* \
3130
$(ISAPI_DIR)/doc/*.html \
3231
$(PYTHONWIN_DIR)/readme.html $(PYTHONWIN_DIR)/doc/* $(PYTHONWIN_DIR)/doc/debugger/* \
3332
../CHANGES.txt \

com/win32com/HTML/docindex.html

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@ <H1>PythonCOM Documentation Index</H1>
1616
<P><A HREF="variant.html">An advanced VARIANT object which can give more control over parameter types</A></P>
1717
<P><A HREF="package.html">A brief description of the win32com package structure</A></P>
1818
<P><A HREF="PythonCOM.html">Python COM Implementation documentation</A></P>
19-
<P><A HREF="misc.html">Misc stuff I don’t know where to put anywhere else</A></P>
20-
<H3>ActiveX Scripting</H3>
21-
<P><A HREF="../../win32comext/axscript/demos/client/ie/demo.htm">ActiveX Scripting Demos</A></P></BODY>
19+
<P><A HREF="misc.html">Misc stuff I don't know where to put anywhere else</A></P>
2220
</HTML>

com/win32comext/axscript/client/framework.py

+1-42
Original file line numberDiff line numberDiff line change
@@ -510,35 +510,13 @@ def FindBuildSubItemEvents(self):
510510
result = self.dispatch.Invoke(
511511
dispid, 0x0, pythoncom.DISPATCH_PROPERTYGET, 1
512512
)
513-
# IE has an interesting problem - there are lots of synonyms for the same object. Eg
514-
# in a simple form, "window.top", "window.window", "window.parent", "window.self"
515-
# all refer to the same object. Our event implementation code does not differentiate
516-
# eg, "window_onload" will fire for *all* objects named "window". Thus,
517-
# "window" and "window.window" will fire the same event handler :(
518-
# One option would be to check if the sub-object is indeed the
519-
# parent object - however, this would stop "top_onload" from firing,
520-
# as no event handler for "top" would work.
521-
# I think we simply need to connect to a *single* event handler.
522-
# As use in IE is deprecated, I am not solving this now.
523513
if isinstance(
524514
result, pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
525515
):
526516
name = names[0]
527517
subObj = self.GetCreateSubItem(
528518
self, name, result, axscript.SCRIPTITEM_ISVISIBLE
529519
)
530-
# print(
531-
# "subobj",
532-
# name,
533-
# "flags are",
534-
# subObj.flags,
535-
# "mydisp=",
536-
# self.dispatch,
537-
# "result disp=",
538-
# result,
539-
# "compare=",
540-
# self.dispatch == result,
541-
# )
542520
subObj.BuildEvents()
543521
subObj.Register()
544522
except pythoncom.com_error:
@@ -727,15 +705,6 @@ def ParseProcedureText(
727705
startingLineNumber,
728706
flags,
729707
)
730-
# NOTE - this is never called, as we have disabled this interface.
731-
# Problem is, once enabled all even code comes via here, rather than AddScriptlet.
732-
# However, the "procName" is always an empty string - ie, itemName is the object whose event we are handling,
733-
# but no idea what the specific event is!?
734-
# Problem is disabling this block is that AddScriptlet is _not_ passed
735-
# <SCRIPT for="whatever" event="onClick" language="Python">
736-
# (but even for those blocks, the "onClick" information is still missing!?!?!?)
737-
738-
# self.DoAddScriptlet(None, code, itemName, subItemName, eventName, delimiter,sourceContextCookie, startLineNumber)
739708
return None
740709

741710
#
@@ -925,21 +894,11 @@ def Clone(self):
925894
#
926895
# IObjectSafety
927896

928-
# Note that IE seems to insist we say we support all the flags, even tho
929-
# we don't accept them all. If unknown flags come in, they are ignored, and never
930-
# reflected in GetInterfaceSafetyOptions and the QIs obviously fail, but still IE
931-
# allows our engine to initialize.
932897
def SetInterfaceSafetyOptions(self, iid, optionsMask, enabledOptions):
933-
# trace ("SetInterfaceSafetyOptions", iid, optionsMask, enabledOptions)
898+
# trace("SetInterfaceSafetyOptions", iid, optionsMask, enabledOptions)
934899
if optionsMask & enabledOptions == 0:
935900
return
936901

937-
# See comments above.
938-
# if (optionsMask & enabledOptions & \
939-
# ~(axscript.INTERFACESAFE_FOR_UNTRUSTED_DATA | axscript.INTERFACESAFE_FOR_UNTRUSTED_CALLER)):
940-
# # request for options we don't understand
941-
# RaiseAssert(scode=winerror.E_FAIL, desc="Unknown safety options")
942-
943902
if iid in [
944903
pythoncom.IID_IPersist,
945904
pythoncom.IID_IPersistStream,

com/win32comext/axscript/client/pyscript.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,8 @@ def DoAddScriptlet(
309309
):
310310
# Just store the code away - compile when called. (JIT :-)
311311
item = self.GetNamedItem(itemName)
312-
if (
313-
itemName == subItemName
314-
): # Explicit handlers - eg <SCRIPT LANGUAGE="Python" for="TestForm" Event="onSubmit">
312+
if itemName == subItemName:
313+
# Explicit handlers - eg <SCRIPT LANGUAGE="Python" RUNAT=Server for="TestForm" Event="onSubmit">
315314
subItem = item
316315
else:
317316
subItem = item.GetCreateSubItem(item, subItemName, None, None)

com/win32comext/axscript/client/pyscript_rexec.py

-54
This file was deleted.

com/win32comext/axscript/demos/client/ie/CHARTPY.HTM

-180
This file was deleted.

com/win32comext/axscript/demos/client/ie/FOO.HTM

-46
This file was deleted.

0 commit comments

Comments
 (0)