Search

CN-121980100-A - Page loading method and device, electronic equipment and storage medium

CN121980100ACN 121980100 ACN121980100 ACN 121980100ACN-121980100-A

Abstract

The invention discloses a page loading method and device, electronic equipment and a storage medium, and belongs to the technical field of Internet. The method comprises the steps of determining a control to be called of a preset control type from page source codes, creating an extension control object compatible with a control interface to be called, wherein the extension control object is used for analyzing calling behaviors of the control to be called into loading instructions of page metadata so as to achieve semantic level replacement of functions of the control to be called, and responding to a calling request for the control to be called by using the extension control object in the execution process of the page source codes, and loading corresponding page metadata based on the calling request so as to complete page rendering. According to the method and the device for loading the page source code, the control to be invoked, which cannot be supported by the native browser, is replaced, so that the native browser can normally load the page source code containing the preset control type.

Inventors

  • CHEN BINBIN
  • YU YIN

Assignees

  • 龙芯中科(合肥)技术有限公司

Dates

Publication Date
20260505
Application Date
20251212

Claims (11)

  1. 1. A method of page loading, the method comprising: determining a control to be called of a preset control type from page source codes, wherein the control to be called is incompatible with a browser kernel for displaying a page to be loaded; creating an extension control object compatible with the control interface to be called, wherein the extension control object is used for analyzing the calling behavior of the control to be called into a loading instruction of page metadata so as to realize semantic level replacement of the control function to be called; And in the execution process of the page source code, responding to a call request for the control to be called by utilizing the extension control object, and loading corresponding page metadata based on the call request so as to complete page rendering.
  2. 2. The method of claim 1, wherein the extension control Object is implementable based on Object elements, script generation objects, or component instances.
  3. 3. The page loading method according to claim 2, wherein the determining the control to be invoked of the preset control type from the page source code includes: identifying a control identification attribute name corresponding to the preset control type from the Object element of the page source code; and determining the control to be called based on the field where the control identification attribute name is located.
  4. 4. The page loading method according to claim 1, wherein the determining, from the page source code, the control to be invoked of the preset control type includes: acquiring a control creation request sent by a control operation interface corresponding to the preset control type in the process of executing codes in the page source code; and determining the control to be invoked based on the control creation request.
  5. 5. The page loading method of claim 2, wherein the creating an extended control object compatible with the control interface to be invoked comprises: Loading the expansion Object element under the condition that the expansion Object element corresponding to the control to be called is contained in a kernel expansion Object element library so as to create an expansion Object element Object, wherein the expansion Object element Object is an expansion control Object realized based on the Object element; And under the condition that the kernel expansion Object element library does not contain the expansion Object element corresponding to the control to be called, acquiring the expansion Object element corresponding to the control to be called from a server, and loading the expansion Object element to create the expansion Object element Object.
  6. 6. The method for loading a page according to claim 5, wherein the obtaining, from a server, the extension Object element corresponding to the control to be invoked includes: And sending a control identifier corresponding to the control to be called and a kernel identifier corresponding to the kernel of the local browser to the server, so that the server returns a corresponding extension Object element based on the control identifier and the kernel identifier.
  7. 7. The page loading method according to claim 1, wherein the responding to the call request for the control to be called by using the extension control object in the execution process of the page source code includes: Determining a call category corresponding to a call request aiming at the call request initiated by the control to be called in the page source code executing process, wherein the call category comprises external call and internal call; Processing the call request through the interface of the extension control object under the condition that the call type of the call request is the internal call; and processing the call request through an object element interface of a local browser kernel under the condition that the call type of the call request is the external call.
  8. 8. The page loading method as recited in any one of claims 1 to 7, wherein the preset control type includes an ActiveX type.
  9. 9. A page loading apparatus, the apparatus comprising: the determining module is used for determining a control to be called of a preset control type from the page source code, wherein the control to be called is incompatible with a browser kernel for displaying a page to be loaded; The creating module is used for creating an extension control object compatible with the control interface to be called, wherein the extension control object is used for analyzing the calling behavior of the control to be called into a loading instruction of page metadata so as to realize semantic level replacement of the control function to be called; And the loading module is used for responding to a call request for the control to be called by utilizing the extension control object in the execution process of the page source code, and loading corresponding page metadata based on the call request so as to complete page rendering.
  10. 10. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implements the page loading method of any of claims 1 to 8.
  11. 11. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implements the page loading method of any one of claims 1 to 8.

Description

Page loading method and device, electronic equipment and storage medium Technical Field The invention belongs to the technical field of Internet, and particularly relates to a page loading method, a page loading device, electronic equipment and a storage medium. Background The access to the pages on the network through the browser is an important component of the internet technology, and along with the continuous development of the internet technology, the browser is continuously promoted to appear so as to meet the increasingly abundant user demands and safety demands. Some web pages use controls that can only be adapted to a particular browser, and compatibility issues may exist when other, non-adapted browsers access these pages. In the prior art, an adapted webpage version is usually developed for different browser kernels at a service end, so that the webpage only contains control types originally supported by the corresponding browser kernel. When the user side accesses the webpage through the browser, the service side selects a proper webpage version according to the kernel of the user browser and feeds the webpage version back to the user side, so that the browser of the user side can normally load and display the webpage. However, developing web page versions suitable for different browser kernels is time-consuming and labor-consuming, and it is quite possible that due to cost factors, lack of maintenance and other factors, a service end can only provide a user with page source codes containing control incompatible with the user browser kernels, so that poor compatibility of the control in the user browser and the page to be accessed still can occur in the related technology, and the page cannot be loaded normally. Disclosure of Invention The embodiment of the invention aims to provide a page loading method, a device, electronic equipment and a storage medium, which can solve the problem that pages containing specific controls cannot be normally loaded on pages in the prior art. In a first aspect, an embodiment of the present invention provides a page loading method, where the method includes: determining a control to be called of a preset control type from page source codes, wherein the control to be called is incompatible with a browser kernel for displaying a page to be loaded; creating an extension control object compatible with the control interface to be called, wherein the extension control object is used for analyzing the calling behavior of the control to be called into a loading instruction of page metadata so as to realize semantic level replacement of the control function to be called; And in the execution process of the page source code, responding to a call request for the control to be called by utilizing the extension control object, and loading corresponding page metadata based on the call request so as to complete page rendering. In a second aspect, an embodiment of the present invention provides a page loading apparatus, including: the determining module is used for determining a control to be called of a preset control type from the page source code, wherein the control to be called is incompatible with a browser kernel for displaying a page to be loaded; The creating module is used for creating an extension control object compatible with the control interface to be called, wherein the extension control object is used for analyzing the calling behavior of the control to be called into a loading instruction of page metadata so as to realize semantic level replacement of the control function to be called; And the loading module is used for responding to a call request for the control to be called by utilizing the extension control object in the execution process of the page source code, and loading corresponding page metadata based on the call request so as to complete page rendering. In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes a processor and a memory, where the memory stores a program or an instruction that can be executed on the processor, and the program or the instruction implement the page loading method described above when executed by the processor. In a fourth aspect, embodiments of the present invention provide a readable storage medium having stored thereon a program or instructions which, when executed by a processor, implement the above-described page loading method. The embodiment of the invention provides a page loading method, which comprises the steps of determining a control to be called of a preset control type from page source codes, creating an extension control object compatible with an interface of the control to be called, wherein the extension control object is used for analyzing calling behaviors of the control to be called into loading instructions of page metadata so as to realize semantic level replacement of functions of the control to be called, and responding to a call