CN109343906B - Method for loading ActiveX control by browser - Google Patents

Method for loading ActiveX control by browser Download PDF

Info

Publication number
CN109343906B
CN109343906B CN201811198627.7A CN201811198627A CN109343906B CN 109343906 B CN109343906 B CN 109343906B CN 201811198627 A CN201811198627 A CN 201811198627A CN 109343906 B CN109343906 B CN 109343906B
Authority
CN
China
Prior art keywords
activex
script
browser
interface
attribute
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811198627.7A
Other languages
Chinese (zh)
Other versions
CN109343906A (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangxi Jinge Technology Co ltd
Original Assignee
Jiangxi Kinggrid Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangxi Kinggrid Technology Co ltd filed Critical Jiangxi Kinggrid Technology Co ltd
Priority to CN201811198627.7A priority Critical patent/CN109343906B/en
Publication of CN109343906A publication Critical patent/CN109343906A/en
Application granted granted Critical
Publication of CN109343906B publication Critical patent/CN109343906B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method for loading an ActiveX control by a Chrome browser, which is characterized by judging whether an ActiveX object is created or not when position information of an interface object is changed due to the change of webpage position information; determining according to the attribute of the ActiveX object and the method return value, if the return value is IDispatch type, creating a script object of script object, and returning to the browser; when the browser executes the JavaScript about the attributes and the methods of the ActiveX object, the attributes or the method calls which the ActiveX object should execute are searched according to the script object interface parameters on the script object instance, and then the corresponding attributes and method calls are executed. The interface is simple and easy to integrate to the application system.

Description

Method for loading ActiveX control by browser
Technical Field
The invention relates to a browser control technology, in particular to a method for loading an ActiveX control by a browser.
Background
Interpretation of terms:
ActiveX controls: microsoft corporation refers to a family of strategic object-oriented programming techniques and tools, the primary technique being the Component Object Model (COM), which is synonymous with the terms ActiveX, control, etc. herein.
Chrome browser: a web browser developed by Google corporation that is based on other open source software writing, including WebKit, aims to promote stability, speed, and security, and creates simple and efficient user interface software.
An ActiveX control can be viewed as a very small server application that cannot run independently and must be embedded in a container program to run with the container. This container includes a WEB page. The IE browser that we commonly use is a typical ActiveX container, which can browse and use ActiveX controls embedded in WEB pages.
The Chrome browser is not an ActiveX container per se, and cannot directly browse ActiveX controls in a WEB page. Therefore, Chrome uses netscape plug-in Application Programming interface (npapi) as a browser plug-in to load ActiveX.
Because of the security concern, the plug-in of the NPAPI can steal the system bottom authority and launch malicious attack. Therefore, in 2010, Chrome develops a new PPAPI (Peerplug-in API) on the basis of the original netscape NPAPI, all plug-ins are put into a sandbox to operate, and the support of the PPAPI interface is stopped at Chrome45 and subsequent versions. But this also seals all ActiveX control load interface in Chrome, some trusted ActiveX control is rejected by Chrome. The Chrome browser stops supporting the NPAPI interface, which means that a large number of legacy trusted middleware products will no longer be supported by the new version of the Chrome browser.
Disclosure of Invention
The invention provides a universal solution for loading ActiveX in Chrome45 and subsequent versions, which enables a PPAPI plug-in program to set up a bridge between a Chrome browser and a trusted ActiveX, so that the Chrome browser can create and use ActvieX through JavaScript as if an IE browser uses ActiveX.
The invention adopts the following technical scheme to achieve the purpose. A method for loading an ActiveX control by a Chrome browser comprises the following steps: the PPAPI plug-in program, the instantiated InstancePrivate interface object, the creation, display state and position information of an ActiveX object controlled by the interface object, and the script object to the proxy of the ActiveX object, and the proxy of the ActiveX object provides the method and attribute access of the ActvieX; when the position information of the webpage changes and the interface object changes the position information, judging whether an ActiveX object is created, if not, creating the ActiveX object; if created, ignore; an InstancePrivate instance corresponds to only one ActiveX object; according to the InstancePravate interface parameters, the display and the hiding of the ActiveX object and the position of the ActiveX object are transformed; determining according to the attribute of the ActiveX object and the method return value, if the return value is IDispatch type, creating a script object of script object, and returning to the browser; and searching the attribute or method call which should be executed by the ActiveX object according to the script object interface parameter on the script object instance, and then executing the corresponding attribute and method call.
In the invention, ActiveX is loaded by the Chrome PPAPI plugin, and three parts of creating a control, calling attributes and methods on an interface and responding to an event are mainly realized. ActiveX is created based on CLSID, so it is a universal creation mode applicable to all ActiveX. After the ActiveX is created, the Chrome PPAPPI plug-in is provided with an interface proxy module, and an IDispath automation interface of the ActiveX is used for calling the attribute and the method of the ActiveX for the script program of the WEB page to provide proxy service. If ActiveX throws an event while in use, the Chrome PPAPPI plug-in will look up and call a script response program on the WEB page for this event.
The invention realizes that the Chrome uses JavaScript codes to call the attribute and the method of the ActiveX by creating the PPAPI plug-in the Chrome browser, creating the ActiveX control by the PPAPI plug-in and acting through the PPAPI plug-in; through the PPAPI plugin proxy, Chrome responds to ActiveX's events using JavaScript code. Can support the creation of all activexs; the attribute and method of ActiveX can be called by supporting WEB page script; the event that WEB page scripts respond to ActiveX can be supported; the interface is simple and easy to integrate to the application system. Loading and using an ActiveX mode in a Chrome browser; compared with the NPAPI plug-in, the plug-in is only used for the version below the Chrome browser 45 and is suitable for all the Chrome browser versions; the property and method calling of ActiveX are kept consistent with those in IE browser in syntax; the CLSID is only needed to be transformed to be applicable to all activexs.
Drawings
FIG. 1 is a block diagram of the system architecture of the present invention.
FIG. 2 is a Chrome browser and InstantPrimate relationship diagram;
FIG. 3 is a Chrome browser and script object relationship diagram;
FIG. 4 is a script object proxy ActiveX object flow diagram;
FIG. 5 is a diagram of the event response relationship of the Chrome browser to ActiveX.
Detailed Description
The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and examples. The scheme adopted by the invention is as follows: the Chrome browser informs the PPAPI plugin of the intent to use ActiveX through JavaScript, the PPAPI plugin acts as a proxy, creates ActiveX, calls ActiveX properties and methods, and responds to ActiveX events.
See fig. 1 for a block diagram of the system architecture. The Chrome browser encapsulates the creation, calling and event response of ActiveX in a PPAPPI plug-in by loading ActiveX. The PPAPI plug-in acts as a proxy between the Chrome browser and ActiveX.
The PPAPI plug-in provides an instancePravate instance to the Chrome browser, the Chrome browser controls information such as the position and the display state of the PPAPI plug-in through the instance, and the Chrome browser manages the life cycle of an instancePravate instance object. A scripted object (script object) is created in the life cycle of the InstancePrivate instance object, the scripted object creates an ActiveX object, and finally the PPAPI plug-in returns the scripted object to the Chrome browser. Thereafter, the JavsScript engine of the Chrome browser can manipulate this scripted object through WEB scripting, and in fact, the Chrome browser manipulates an ActiveX object through a proxy for this scripted object, such as calling property methods, responding to events, and the like.
See fig. 2 and 3. The script object instance acts as a proxy between the Chrome browser and the ActiveX object, and converts the browser's operations on the script object's properties and methods into operations on the ActiveX's properties and methods.
See fig. 4. The ScriptObject is the core of the invention as a Chrome browser access agent to ActiveX objects. The script object acts as a proxy of an ActiveX object, and is viewed by the Chrome browser, namely the script object is ActiveX, and the JavaScript statement call for the attributes and the method of the ActiveX is the JavaScript statement call for the script object. For example, an ActiveX object has an attribute named prop, then according to the JavaScript object access syntax, the statement that assigns prop should be "activexObject. prop = 1", "activexObject is an instance of an ActiveX object", and a script object as a proxy should also support the same syntax, "activexObject. prop = 1", but this time activexObject is an instance of a script object. Then the conversion from script object to ActiveX object is one of the core of the present invention.
See fig. 5. The event of the ActiveX control enables the control to send an event notification to a container containing the ActiveX control, namely a webpage in a Chrome browser, the webpage calls an event processing function in a webpage script after receiving the event notification, and the webpage application program can realize that the event processing function makes a specific response to a specific event. The relation between the webpage script and the ActiveX event is established through an instancePrimate object, one side of the instancePrimate object receives the ActiveX event, the other side of the instancePrimate object is provided with an Window object of the webpage script, and the event response function in the webpage script can be called through the Window of the webpage script.
Chrome browser ActiveX plug-in system. Although the Chrome browser, especially after version 45, has been completely prohibited from using ActiveX for security reasons, there are still many ActiveX that can be trusted that should be supported on the Chrome browser for historical reasons. The Chrome browser ActiveX plug-in system allows ActiveX to be used in Chrome browser pages and maintains the same usage style as before in IE.

Claims (1)

1. A method for loading an ActiveX control by a Chrome browser comprises the following steps: the PPAPI plug-in program, the instantiated InstancePrivate interface object, the creation, display state and position information of an ActiveX object controlled by the interface object, and the script object to the proxy of the ActiveX object, and the proxy of the ActiveX object provides the method and attribute access of the ActvieX; when the position information of the webpage changes and the interface object changes the position information, judging whether an ActiveX object is created, if not, creating the ActiveX object; if created, ignore; an InstancePrivate instance corresponds to only one ActiveX object; according to the InstancePravate interface parameters, the display and the hiding of the ActiveX object and the position of the ActiveX object are transformed; determining according to the attribute of the ActiveX object and the method return value, if the return value is IDispatch type, creating a script object of script object, and returning to the browser; and searching the attribute or method call which should be executed by the ActiveX object according to the script object interface parameter on the script object instance, and then executing the corresponding attribute and method call.
CN201811198627.7A 2018-10-15 2018-10-15 Method for loading ActiveX control by browser Active CN109343906B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811198627.7A CN109343906B (en) 2018-10-15 2018-10-15 Method for loading ActiveX control by browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811198627.7A CN109343906B (en) 2018-10-15 2018-10-15 Method for loading ActiveX control by browser

Publications (2)

Publication Number Publication Date
CN109343906A CN109343906A (en) 2019-02-15
CN109343906B true CN109343906B (en) 2021-06-25

Family

ID=65310397

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811198627.7A Active CN109343906B (en) 2018-10-15 2018-10-15 Method for loading ActiveX control by browser

Country Status (1)

Country Link
CN (1) CN109343906B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457145A (en) * 2019-08-19 2019-11-15 四川久远银海软件股份有限公司 A kind of cross-platform browser peripheral hardware call method
CN110532043A (en) * 2019-09-02 2019-12-03 江西金格科技股份有限公司 The method for supporting NPAPI and ActiveX based on insert receptacle
CN111176752B (en) * 2019-12-20 2023-05-16 汪佐怀 Method and device for embedding window applet in browser page
CN111158784A (en) * 2019-12-30 2020-05-15 山东浪潮商用系统有限公司 Solution method for loading ActiveX control based on Google browser
CN112433789B (en) * 2020-11-24 2024-05-24 深圳供电局有限公司 Intelligent device access management method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699380A (en) * 2013-12-19 2014-04-02 瑞达信息安全产业股份有限公司 Method and system for running ActiveX control in Firefox browser
KR101683273B1 (en) * 2015-11-24 2016-12-07 쉬프트정보통신 주식회사 Device for displaying a frame of a web browser on another web browser
CN106776074A (en) * 2016-12-26 2017-05-31 湖北省数字证书认证管理中心有限公司 A kind of web plug-in units call method and system based on http

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699380A (en) * 2013-12-19 2014-04-02 瑞达信息安全产业股份有限公司 Method and system for running ActiveX control in Firefox browser
KR101683273B1 (en) * 2015-11-24 2016-12-07 쉬프트정보통신 주식회사 Device for displaying a frame of a web browser on another web browser
CN106776074A (en) * 2016-12-26 2017-05-31 湖北省数字证书认证管理中心有限公司 A kind of web plug-in units call method and system based on http

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Firefox中支持ActiveX控件运行的研究与实现;张震;《中国优秀硕士论文全文数据库 信息科技辑》;20090515;第I138-462页 *

Also Published As

Publication number Publication date
CN109343906A (en) 2019-02-15

Similar Documents

Publication Publication Date Title
CN109343906B (en) Method for loading ActiveX control by browser
US8627216B2 (en) Rendering hypertext markup language content
KR100260682B1 (en) A process for running applets over non-ip networks
US7627865B2 (en) Method and apparatus for accessing instrumentation data from within a managed code environment
US6275868B1 (en) Script Engine interface for multiple languages
CN101470621B (en) Virtual machine configuration system
US7734687B2 (en) Environment service architectures for netcentric computing systems
US20050229186A1 (en) Method and apparatus for dynamic runtime object aggregation
US9116680B2 (en) Dynamically building locale objects or subsections of locale objects based on historical data
US20110131556A1 (en) Method, computer program and computer system for converting source code written in dynamically typed language into target code written in statically typed language and executing target code
US20070168949A1 (en) System supporting object-oriented constructs in ECMAScript
US20150095760A1 (en) Method and Device for Providing Webpage Browsing Based on Webkit Kernel
CN102929656A (en) Method for using ActiveX plug-in in browser, and client
CN100590597C (en) Local resource access method and device
US20080163266A1 (en) Mechanism for transparently interfacing with a third party version control system
CN110716720A (en) Method and device for realizing application hot deployment
CN103226474A (en) Method, device and system for interaction between webpage script and browser program
US6675227B1 (en) Method for providing a service implementation for both EJB and non-EJB environments
CN104423932B (en) The method that Binary Element is called in Javascript
EP1192532B1 (en) Extending the attributes of an application generated using a fourth generation programming tool
JP2006276939A (en) Program starting method for virtual machine, and client server system
Mostinckx et al. Mirages: Behavioral intercession in a mirror-based architecture
CN113590116A (en) BS mode-based non-embedded Office using method in OA system
Hunt et al. Reflection and Bean Introspection
Olsson et al. Overriding

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 330096 15th floor, lvyue science and technology building, 579 torch street, high tech Zone, Nanchang City, Jiangxi Province

Patentee after: Jiangxi Jinge Technology Co.,Ltd.

Address before: 330096 15th floor, lvyue science and technology building, 579 torch street, high tech Zone, Nanchang City, Jiangxi Province

Patentee before: JIANGXI KINGGRID TECHNOLOGY CO.,LTD.

CP01 Change in the name or title of a patent holder