CN109558181B - Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment - Google Patents
Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment Download PDFInfo
- Publication number
- CN109558181B CN109558181B CN201811431421.4A CN201811431421A CN109558181B CN 109558181 B CN109558181 B CN 109558181B CN 201811431421 A CN201811431421 A CN 201811431421A CN 109558181 B CN109558181 B CN 109558181B
- Authority
- CN
- China
- Prior art keywords
- ocx control
- browser
- ocx
- npapi
- plug
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method for enabling a non-IE browser to be compatible with an OCX control, a computer storage medium and electronic equipment, wherein the method comprises the following steps: and loading the OCX control through the NPAPI plug-in to realize indirect support of the OCX control by the browser. According to the method for the compatibility of the OCX control by the non-IE browser, provided by the embodiment of the invention, the NPAPI is used as a bridge according to the technical standard of the NPAPI (network scene plugin application programming interface) plugin which is made by the non-IE kernel browser and supports Netscape, so that the purpose that the OCX control is compatible by the non-IE browser is achieved, and finally, the code multiplexing effect and the purpose that the plugin is used across browsers are achieved.
Description
Technical Field
The invention relates to the field of browsers, in particular to a method for enabling a non-IE browser to be compatible with an OCX control, a computer storage medium and electronic equipment.
Background
With the development of network technology, the B/S mode is more used by people. At present, the mainstream windows platform browsers in China include IE, Firefox, Google Chrome, 360 security browser and the like. The existence of the plug-in enriches the functions of the WEB browser. The IE browser uses an ActiveX control as a plug-in, but the browser of a non-IE kernel cannot directly support the plug-in, so that the code multiplexing effect and the purpose of cross-browser use of the plug-in cannot be achieved.
Disclosure of Invention
In view of this, the present invention provides a method, a computer storage medium, and an electronic device for enabling a non-IE browser to be compatible with an OCX control, where the method is capable of enabling the non-IE browser to be compatible with the OCX control.
In order to solve the above technical problem, in one aspect, the present invention provides a method for enabling a non-IE browser to be compatible with an OCX control, where the method includes: and loading the OCX control through the NPAPI plug-in to realize indirect support of the OCX control by the browser.
According to some embodiments of the invention, the method comprises: the JavaScript creates or acquires an NPAPI plug-in object through an interface to call the NPAPI plug-in; and calling the OCX control through the NPAPI plug-in.
According to some embodiments of the invention, making a call to the OCX control through the NPAPI plug-in comprises: the browser inquires whether the NPAPI plug-in supports the OCX control, if not, an error is returned, and if so, parameter conversion and verification are carried out on the OCX control; and if the parameters are correct, calling the OCX control.
According to some embodiments of the invention, the browser queries the NPAPI plug-in for whether OCX controls are supported.
According to some embodiments of the invention, the NPAPI plug-in calls a function of the same-name OCX control when the parameter is correct.
According to some embodiments of the present invention, the performing parameter conversion and verification on the OCX control includes: loading and initializing an OCX control in the initialization process of the NPAPI plug-in object; in the process of the reverse initialization, the OCX control is reversely initialized and unloaded; and realizing the support of the OCX control interface with the same name and the same parameter in the NPAPI plug-in object.
According to some embodiments of the invention, the non-IE browsers include Firefox, Google Chrome, and 360 Security browsers.
In a second aspect, embodiments of the present invention provide a computer storage medium comprising one or more computer instructions that, when executed, implement a method as in the above embodiments.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, where the memory is used to store one or more computer instructions; the processor is configured to invoke and execute the one or more computer instructions to implement the method according to the above-described embodiments.
The technical scheme of the invention has at least one of the following beneficial effects:
according to the method for enabling the non-IE browser to be compatible with the OCX control, the computer storage medium and the electronic device, provided by the embodiment of the invention, the NPAPI (network view plug-in application programming interface) is used as a bridge according to the technical standard of the NPAPI plug-in which the non-IE kernel browser supports Netscape, so that the purpose of enabling the non-IE browser to be compatible with the OCX control is achieved, and finally, the code multiplexing effect and the purpose of using the plug-in across browsers are achieved.
Drawings
Fig. 1 is a flowchart of a method for enabling a non-IE browser to be compatible with an OCX control according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an electronic device according to an embodiment of the invention.
Reference numerals:
a method 100 for a non-IE browser to be compatible with OCX controls;
an electronic device 300;
a memory 310; an operating system 311; an application 312;
a processor 320; a network interface 330; an input device 340; a hard disk 350; a display device 360.
Detailed Description
The following detailed description of embodiments of the present invention will be made with reference to the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
The following first describes the method 100 for the non-IE browser compatible OCX control according to the embodiment of the present invention in detail with reference to the drawings.
The method 100 for enabling the non-IE browser to be compatible with the OCX control according to the embodiment of the invention comprises the following steps: and loading the OCX control through the NPAPI plug-in to realize indirect support of the OCX control by the browser.
In other words, according to the method 100 for enabling the non-IE browser to be compatible with the OCX control in the embodiment of the present invention, the NPAPI can be used as a bridge according to the technical standard of the NPAPI (Netscape plug-in application programming interface) plug-in that the non-IE kernel browser generally supports Netscape, and the OCX control is loaded through the NPAPI plug-in, so that the indirect support of the browser on the OCX control is realized, and the purpose of enabling the non-IE browser to be compatible with the OCX control is achieved.
Specifically, as shown in fig. 1, the specific method for implementing indirect support of the OCX control by the browser by loading the OCX control through the NPAPI plug-in includes:
the JavaScript creates or obtains NPAPI plug-in objects through the interface to make calls to the NPAPI plug-ins.
And calling the OCX control through the NPAPI plug-in.
That is, when the OCX control is loaded through the NPAPI plug-in, the NPAPI plug-in standard treats the plug-in as an object, and the JavaScript creates or acquires the NPAPI plug-in object through a specific interface to make a call to the NPAPI plug-in.
In some embodiments of the present invention, the invoking of the OCX control by the NPAPI plug-in includes the following steps:
the browser inquires whether the NPAPI plug-in supports the OCX control, if not, an error is returned, and if so, parameter conversion and verification are carried out on the OCX control.
And if the parameters are correct, calling the OCX control.
Optionally, the browser queries whether the NPAPI plug-in supports a certain method of the OCX control, and further, the NPAPI plug-in calls a function of a certain method of the OCX control of the same name.
That is, taking a fire fox browser as an example, when the OCX interface is called by using the fire fox browser, the browser queries whether the NPAPI plug-in supports the method Fun1(), and if not, returns an error, and if so, performs parameter conversion and verification. If the parameters are correct, the same-name ocx.fun1() function is called. Thus, calling of the NPAPI plug-in can be realized.
It should be noted that, at this time, the JavaScript only calls the NPAPI plug-in, and to implement the call of the OCX control, the NPAPI plug-in further needs to implement the following functions:
specifically, the parameter conversion and verification of the OCX control includes:
and loading and initializing the OCX control in the initialization process of the NPAPI plug-in object.
And in the process of the reverse initialization, the OCX control is reversely initialized and unloaded.
And realizing the support of the OCX control interface with the same name and the same parameter in the NPAPI plug-in object.
In other words, the process of parameter conversion and verification for the OCX control is as follows: the loading and initializing work of the OCX control is completed in the initialization process of the NPAPI plug-in object, the reverse initialization and unloading of the OCX control are completed in the reverse initialization work, and the support of the same name and the same parameters of the OCX interface is realized in the NPAPI plug-in object. Therefore, the calling of the OCX control can be realized.
According to an embodiment of the present invention, the non-IE browsers related in the method 100 for enabling a non-IE browser to be compatible with an OCX control according to the embodiment of the present invention include non-IE kernel browsers such as Firefox, Google Chrome, and 360 security browsers that support NPAPI plug-in standards. The method has wide application range and convenient application.
In summary, according to the method 100 for enabling a non-IE browser to be compatible with an OCX control in the embodiment of the present invention, an NPAPI is used as a bridge, so that the purpose of enabling the non-IE browser to be compatible with the OCX control can be achieved, and finally, the effect of code multiplexing and the purpose of using plug-ins across browsers can be achieved.
In addition, the present invention also provides a computer storage medium comprising one or more computer instructions that, when executed, implement any of the above-described method 100 for a non-IE browser compatible OCX control.
That is, the computer storage medium stores a computer program that, when executed by a processor, causes the processor to perform any of the above-described methods 100 for non-IE browser compatible OCX controls.
As shown in fig. 2, an embodiment of the present invention provides an electronic device 300, which includes a memory 310 and a processor 320, where the memory 310 is configured to store one or more computer instructions, and the processor 320 is configured to call and execute the one or more computer instructions, so as to implement any one of the methods described above.
That is, the electronic device 300 includes: a processor 320 and a memory 310, in which memory 310 computer program instructions are stored, wherein the computer program instructions, when executed by the processor, cause the processor 320 to perform any of the methods 100 described above.
Further, as shown in fig. 2, the electronic device 300 further includes a network interface 330, an input device 340, a hard disk 350, and a display device 360.
The various interfaces and devices described above may be interconnected by a bus architecture. A bus architecture may be any architecture that may include any number of interconnected buses and bridges. Various circuits of one or more Central Processing Units (CPUs), represented in particular by processor 320, and one or more memories, represented by memory 310, are coupled together. The bus architecture may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like. It will be appreciated that a bus architecture is used to enable communications among the components. The bus architecture includes a power bus, a control bus, and a status signal bus, in addition to a data bus, all of which are well known in the art and therefore will not be described in detail herein.
The network interface 330 may be connected to a network (e.g., the internet, a local area network, etc.), and may obtain relevant data from the network and store the relevant data in the hard disk 350.
The input device 340 may receive various commands input by an operator and send the commands to the processor 320 for execution. The input device 340 may include a keyboard or a pointing device (e.g., a mouse, trackball, touch pad, touch screen, or the like).
The display device 360 may display the result of the instructions executed by the processor 320.
The memory 310 is used for storing programs and data necessary for operating the operating system, and data such as intermediate results in the calculation process of the processor 320.
It will be appreciated that memory 310 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read Only Memory (EPROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. The memory 310 of the apparatus and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some embodiments, memory 310 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof: an operating system 311 and application programs 312.
The operating system 311 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks. The application programs 312 include various application programs, such as a Browser (Browser), and are used for implementing various application services. A program implementing methods of embodiments of the present invention may be included in application 312.
The method disclosed by the above embodiment of the present invention can be applied to the processor 320, or implemented by the processor 320. Processor 320 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 320. The processor 320 may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof, configured to implement or perform the methods, steps, and logic blocks disclosed herein. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 310, and the processor 320 reads the information in the memory 310 and completes the steps of the method in combination with the hardware.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
In particular, the processor 320 is also configured to read the computer program and execute any of the methods described above.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the transceiving method according to various embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other media capable of storing program codes.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (6)
1. A method for enabling a non-IE browser to be compatible with an OCX control, the method comprising: loading the OCX control through the NPAPI plug-in to realize indirect support of the OCX control by the browser;
the method further comprises the following steps:
the JavaScript creates or acquires an NPAPI plug-in object through an interface to call the NPAPI plug-in;
calling the OCX control through the NPAPI plug-in;
the NPAPI plug-in calls the OCX control, and the call comprises the following steps:
the browser inquires whether the NPAPI plug-in supports the OCX control, if not, an error is returned, and if so, parameter conversion and verification are carried out on the OCX control;
if the parameters are correct, calling the OCX control;
the parameter conversion and verification of the OCX control comprises the following steps:
loading and initializing an OCX control in the process of initializing an NPAPI plug-in object;
in the process of the reverse initialization, the OCX control is subjected to reverse initialization and unloading;
and realizing the support of the OCX control interface with the same name and the same parameter in the NPAPI plug-in object.
2. The method of claim 1, wherein the browser queries whether an NPAPI plug-in supports OCX controls.
3. The method of claim 2, wherein the NPAPI plug-in calls a function of the same-name OCX control when the parameters are correct.
4. The method of claim 1, wherein the non-IE browsers include Firefox, Google Chrome, and 360 security browsers.
5. A computer storage medium comprising one or more computer instructions which, when executed, implement the method of any one of claims 1-4.
6. An electronic device comprising a memory and a processor, wherein,
the memory is to store one or more computer instructions;
the processor is configured to invoke and execute the one or more computer instructions to implement the method of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811431421.4A CN109558181B (en) | 2018-11-26 | 2018-11-26 | Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811431421.4A CN109558181B (en) | 2018-11-26 | 2018-11-26 | Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109558181A CN109558181A (en) | 2019-04-02 |
CN109558181B true CN109558181B (en) | 2022-07-01 |
Family
ID=65867829
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811431421.4A Active CN109558181B (en) | 2018-11-26 | 2018-11-26 | Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109558181B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110175305B (en) * | 2019-05-05 | 2022-03-11 | 中国银行股份有限公司 | Data processing method, data processing device, computer equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104123157A (en) * | 2014-07-17 | 2014-10-29 | 北京京东尚科信息技术有限公司 | Method and device for customizing cross-platform business logic of mobile terminal |
CN106648627A (en) * | 2016-11-30 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Method and device for migrating live-streaming application software to mozilla firefox browser |
CN106776074A (en) * | 2016-12-26 | 2017-05-31 | 湖北省数字证书认证管理中心有限公司 | A kind of web plug-in units call method and system based on http |
CN108052491A (en) * | 2017-11-22 | 2018-05-18 | 李晓妮 | A kind of automatic processing method and device of certificate document |
CN108279888A (en) * | 2017-12-19 | 2018-07-13 | 中国电子科技集团公司第三十研究所 | A kind of plug-in implement method for supporting more money browsers |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8352967B2 (en) * | 2008-11-10 | 2013-01-08 | Google Inc. | Safe browser plugins using native code modules |
US9124566B2 (en) * | 2009-06-23 | 2015-09-01 | Microsoft Technology Licensing, Llc | Browser plug-in for secure credential submission |
US9210209B2 (en) * | 2011-05-03 | 2015-12-08 | Google Inc. | Extensible browser plugin interface |
CN103064886B (en) * | 2012-12-07 | 2016-02-10 | 百度在线网络技术(北京)有限公司 | Support method and the plug-in unit of many browsers |
CN104102496A (en) * | 2014-08-06 | 2014-10-15 | 浪潮(山东)电子信息有限公司 | Development method for bank self-service system cross-browser plugin based on WINDOWS platform |
-
2018
- 2018-11-26 CN CN201811431421.4A patent/CN109558181B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104123157A (en) * | 2014-07-17 | 2014-10-29 | 北京京东尚科信息技术有限公司 | Method and device for customizing cross-platform business logic of mobile terminal |
CN106648627A (en) * | 2016-11-30 | 2017-05-10 | 武汉斗鱼网络科技有限公司 | Method and device for migrating live-streaming application software to mozilla firefox browser |
CN106776074A (en) * | 2016-12-26 | 2017-05-31 | 湖北省数字证书认证管理中心有限公司 | A kind of web plug-in units call method and system based on http |
CN108052491A (en) * | 2017-11-22 | 2018-05-18 | 李晓妮 | A kind of automatic processing method and device of certificate document |
CN108279888A (en) * | 2017-12-19 | 2018-07-13 | 中国电子科技集团公司第三十研究所 | A kind of plug-in implement method for supporting more money browsers |
Non-Patent Citations (1)
Title |
---|
" Linux中浏览器兼容ActiveX控件机制的设计与实现";冯博文 等;《计算机应用于软件》;20171015;第34卷(第10期);第15-18页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109558181A (en) | 2019-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542399B (en) | Software development method and device, terminal equipment and computer readable storage medium | |
US11281768B1 (en) | Firmware security vulnerability verification service | |
US8621298B2 (en) | Apparatus for protecting against external attack for processor based on arm core and method using the same | |
CN109656637B (en) | Rendering method and device for cross-platform call of OpenGL ES and computer storage medium | |
CN110471690B (en) | Loading method and device for SO file of dynamic link library and storage medium | |
CN112765023B (en) | Test case generation method and device | |
CN105760192A (en) | Registration method and device for service module of system server | |
CN113282351A (en) | Switch starting method and device, electronic equipment and storage medium | |
CN113536174A (en) | Interface loading method, device and equipment | |
CN110677699B (en) | Video stream and/or picture stream data sharing method and device and electronic equipment | |
CN112787795A (en) | Cloud server clock synchronization method, computer storage medium and electronic device | |
CN109558181B (en) | Method for enabling non-IE browser to be compatible with OCX control, computer storage medium and equipment | |
CN111464429B (en) | WeChat applet multi-item compatible sharing method, system, storage medium and equipment | |
CN111385661B (en) | Method, device, terminal and storage medium for voice control of full screen playing | |
CN111443992B (en) | Docker mirror image difference derivation method, computer storage medium and electronic device | |
CN109522174B (en) | Method, device, terminal and storage medium for controlling adb enabling | |
US9697018B2 (en) | Synthesizing inputs to preserve functionality | |
US9778936B1 (en) | Booting a computing system into a manufacturing mode | |
CN111797390A (en) | Program running method and device, electronic equipment and computer readable storage medium | |
CN113254888B (en) | Method for acquiring hardware information, authorization control system and computing equipment | |
US8997044B2 (en) | Overriding system attributes and function returns in a software subsystem | |
US11954017B2 (en) | Dynamic analysis of rest API testing in microservice architecture | |
CN111596997B (en) | UI information request method, device, terminal and storage medium | |
CN111949301B (en) | Application program hot update method, device and computer readable storage medium | |
CN109743405B (en) | Load balancing file uploading method and system, computer storage medium and equipment |
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 |