CN110704125A - Webpage loading method and device, storage medium and terminal equipment - Google Patents

Webpage loading method and device, storage medium and terminal equipment Download PDF

Info

Publication number
CN110704125A
CN110704125A CN201910885751.9A CN201910885751A CN110704125A CN 110704125 A CN110704125 A CN 110704125A CN 201910885751 A CN201910885751 A CN 201910885751A CN 110704125 A CN110704125 A CN 110704125A
Authority
CN
China
Prior art keywords
webpage
script
loading
original
web page
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.)
Pending
Application number
CN201910885751.9A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910885751.9A priority Critical patent/CN110704125A/en
Publication of CN110704125A publication Critical patent/CN110704125A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • 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

Abstract

The embodiment of the invention discloses a webpage loading method, a webpage loading device, a storage medium and terminal equipment, which are applied to the technical field of information processing. Before the life cycle of loading the webpage of the current loaded webpage is completed, the webpage loading terminal injects a script hiding the original webpage into the life cycle of the current loaded webpage for execution, then injects a script to be injected for updating the original webpage into the life cycle for execution, and finally injects a webpage display script into the life cycle for execution. Therefore, the webpage loading terminal can hide the original webpage firstly in the webpage loading process, then execute the content of the script to be injected and finally display the updated original webpage, so that the updated original webpage can not be displayed after the original webpage is displayed under the condition that the original webpage needs to be updated, the updated original webpage can only be directly displayed, and the webpage display can not flicker.

Description

Webpage loading method and device, storage medium and terminal equipment
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a method and an apparatus for loading a web page, a storage medium, and a terminal device.
Background
Generally, a terminal device loads a web page according to a user operation, for example, when a user clicks a certain link or searches information through the web page, the terminal device obtains web page information from a web page server first, and then loads the web page according to the obtained web page information, and in this process, the terminal device calls various functions to load the web page.
In the prior art, after the content of the web page is determined, the web page information is deployed to the web page server, if an application needs to update the original content of the third-party web page, for example, some content in the original content is deleted, and/or new content is added to the original content, the content to be updated may be stored in the currently applied web page server in a certain format, and in the process of loading the updated web page by the terminal device, the content to be updated is injected into the web page for loading. However, in the prior art, the situation of interface flickering often occurs when the updated webpage is displayed, and a user sees the original webpage first and then sees the updated webpage, so that the user experience is poor.
Disclosure of Invention
The embodiment of the invention provides a webpage loading method and device, a storage medium and a terminal device, which can avoid the situation of interface flicker when displaying an updated webpage.
A first aspect of an embodiment of the present invention provides a method for loading a web page, including:
when the webpage loading terminal is determined to be positioned before the life cycle of the webpage loading of the current loaded webpage is completed, injecting a script hiding the original webpage into the life cycle of the current loaded webpage for execution so as to hide the original webpage;
injecting a script to be injected into the life cycle of the currently loaded webpage for execution, wherein the script to be injected is used for updating the currently loaded original webpage;
and injecting a webpage display script into the life cycle of the currently loaded webpage for execution, wherein the webpage display script is used for displaying the updated original webpage.
A second aspect of the embodiments of the present invention provides a web page loading terminal, including:
the hidden injection unit is used for injecting a script for hiding the original webpage into the life cycle of the currently loaded webpage for execution so as to hide the original webpage when the webpage loading terminal is determined to be positioned before the life cycle of the currently loaded webpage for loading the webpage is completed;
the content injection unit is used for injecting a script to be injected into the life cycle of the currently loaded webpage for execution, and the script to be injected is used for updating the currently loaded original webpage;
and the display injection unit is used for injecting a webpage display script into the life cycle of the currently loaded webpage for execution, and the webpage display script is used for displaying the updated original webpage.
A third aspect of the embodiments of the present invention provides a storage medium, where the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the web page loading method according to the first aspect of the embodiments of the present invention.
A fourth aspect of the embodiments of the present invention provides a terminal device, including a processor and a storage medium, where the processor is configured to implement each instruction;
the storage medium is configured to store a plurality of instructions, where the instructions are configured to be loaded by a processor and to perform the method for loading a web page according to the first aspect of the embodiment of the present invention.
It can be seen that, in the method of this embodiment, before the webpage loading of the currently loaded webpage completes the life cycle, the webpage loading terminal injects the script hiding the original webpage into the life cycle of the currently loaded webpage for execution, then injects the script to be injected, which updates the original webpage, into the life cycle for execution, and finally injects the webpage display script into the life cycle for execution. Therefore, the webpage loading terminal can hide the original webpage firstly in the webpage loading process, then execute the content of the script to be injected and finally display the updated original webpage, so that the updated original webpage can not be displayed after the original webpage is displayed under the condition that the original webpage needs to be updated, the updated original webpage can only be directly displayed, and the webpage display can not flicker.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a web page loading method according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for loading a web page according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a method for loading a web page according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a web interface displayed by a browser in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a web page loading terminal according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the invention provides a webpage loading method, which can be applied to the scene shown in fig. 1, and when a webpage loading terminal acquires webpage information, if the webpage information comprises a script to be injected, and the script to be injected is used for indicating to update an original webpage, such as deleting content in the original webpage, adding content or updating content in the original webpage, and the like, the webpage loading terminal can inject the script to be injected in the webpage information into the life cycle of loading the webpage to execute in the process of loading the webpage according to the webpage information, so that the webpage finally displayed by the webpage loading terminal is updated content.
Specifically, the web page loading terminal may implement the web page loading by the following steps:
when the webpage loading terminal is determined to be positioned before the life cycle of the webpage loading of the current loaded webpage is completed, injecting a script hiding the original webpage into the life cycle of the current loaded webpage for execution so as to hide the original webpage; injecting a script to be injected into the life cycle of the currently loaded webpage for execution, wherein the script to be injected is used for updating the currently loaded original webpage; and injecting a webpage display script into the life cycle of the currently loaded webpage for execution, wherein the webpage display script is used for displaying the updated original webpage.
Therefore, the webpage loading terminal can hide the original webpage firstly in the webpage loading process, then execute the content of the script to be injected and finally display the updated original webpage, so that the updated original webpage can not be displayed after the original webpage is displayed under the condition that the original webpage needs to be updated, the updated original webpage can only be directly displayed, and the webpage display can not flicker.
The embodiment of the invention provides a webpage loading method, which is a method executed by a webpage loading terminal, and the flow chart is shown in figure 2 and comprises the following steps:
step 101, when it is determined that the webpage loading terminal is located before the webpage loading life cycle of the currently loaded webpage is completed, injecting a script hiding the original webpage into the life cycle of the currently loaded webpage for execution so as to hide the original webpage.
It can be understood that a user may operate the web page loading terminal, for example, search for a certain piece of information or click a certain web page link, so that the web page loading terminal initiates a web page loading process, and thus, the web page loading terminal may obtain web page information of a web page to be loaded, and if the obtained web page information includes a script to be injected, which indicates that content of an original web page to be loaded needs to be updated, the web page loading terminal may start two threads, one thread is used to execute steps 101 to 103 in this embodiment, and the other thread is used to load a web page according to the web page information; if the acquired webpage information does not include the script to be injected, which indicates that the content of the original webpage to be loaded does not need to be updated, the webpage loading terminal only needs to start one thread for loading the webpage according to the webpage information.
When the webpage loading terminal loads the webpage according to the webpage information, the webpage loading terminal specifically executes the webpage code loading, and in the process of executing the webpage code loading, various functions are called, each function corresponds to a life cycle, so that the process of loading the webpage according to the webpage information can include multiple life cycles, each life cycle can correspond to a sub-process in the process of loading the webpage, and the process can include: loading progress changed (onprogressive changed), loading specified resource (onLoadResource), webpage loading completion (onPageFinished), webpage loading start (onPageStarted), reporting error information (onreceivedreror), icon change (onReceivedIcon) and other life cycles.
In this embodiment, the webpage loading terminal detects a life cycle of the loading progress change, and when a return value of the loading progress change function corresponding to the life cycle is smaller than a preset value (50%, which is an empirical value), it is determined that the webpage loading terminal is located before the life cycle of the currently loaded webpage is completed for loading the webpage. Further, the webpage loading terminal injects the script hiding the original webpage into the life cycle of the currently loaded webpage, specifically, one thread can inject the script hiding the original webpage into the webpage loading code by executing the code of the script injecting the original webpage, so that the other thread executes the script hiding the original webpage in the process of executing the webpage loading code, thereby achieving the purpose of hiding the original webpage. The script can be in any form, for example, a JavaScript (JS) script. The code for injecting the script hiding the original webpage specifically performs script injection hiding the original webpage by calling an injection function through a thread.
Because the script hiding the original webpage is mainly used for hiding the original webpage, and the content of the script hiding the original webpage only relates to the setting of some global variables and global attributes, the webpage loading terminal can repeatedly execute the step injected in the step 101 for many times, specifically, repeatedly execute the code of the script hiding the original webpage for many times, and stop executing the code of the script hiding the original webpage when the return value of the loading progress changing function is greater than the preset value, so that the logic of the original webpage can not be influenced while the original webpage is hidden by another thread.
Further, the code of the script injected into the hidden original webpage includes a preset time, where the preset time is the maximum time interval of hiding the original webpage, and then one thread of the webpage loading terminal needs to inject the preset time into the loaded webpage code, so that when the preset time is exceeded by another thread, the hidden original webpage is stopped, and it is ensured that the subsequent flow is normal and the webpage can be normally displayed.
And 102, injecting a script to be injected into the life cycle of the currently loaded webpage for execution, wherein the script to be injected is used for updating the currently loaded original webpage.
Specifically, one thread of the web page loading terminal may directly call a certain interface function, such as a web page script estimation function (webview. evaluatejavascript), and inject the script to be injected into the loaded web page code, so that another thread executes the script to be injected in the process of executing the loaded web page code, thereby achieving the purpose of updating the original web page.
Wherein, the updating of the original webpage may include: deleting the content in the original webpage, adding new content in the original webpage, or updating the content in the original webpage, etc. The scripts to be injected corresponding to each webpage can be the same or different.
And 103, injecting a webpage display script into the life cycle of the currently loaded webpage for execution, wherein the webpage display script is used for displaying the updated original webpage.
Specifically, when a thread of the web page loading terminal injects a script to be injected, a Callback function is introduced to be executed by a thread loading a web page code, that is, another thread, so that when the thread of the web page loading terminal executes the step 103, an interface function, for example, a webview.
It can be seen that, in the method of this embodiment, before the webpage loading of the currently loaded webpage completes the life cycle, the webpage loading terminal injects the script hiding the original webpage into the life cycle of the currently loaded webpage for execution, then injects the script to be injected, which updates the original webpage, into the life cycle for execution, and finally injects the webpage display script into the life cycle for execution. Therefore, the webpage loading terminal can hide the original webpage firstly in the webpage loading process, then execute the content of the script to be injected and finally display the updated original webpage, so that the updated original webpage can not be displayed after the original webpage is displayed under the condition that the original webpage needs to be updated, the updated original webpage can only be directly displayed, and the webpage display can not flicker.
A specific application example is used below to describe the web page loading method of the present invention, in this embodiment, the web page loading terminal is specifically a browser, and the method of this embodiment may include the following steps, and a flowchart is shown in fig. 3, and includes:
step 201, a user operates a browser, for example, clicks a web page link of a certain web page, or searches for a web page, the browser obtains web page information of a web page to be loaded according to user operation information, and if the web page information includes a script to be injected, which may be a JS script specifically, the browser starts two threads, which are specifically a first thread and a second thread in this embodiment.
For the case that the script to be injected is not included in the web page information, the browser only starts one thread to load the corresponding web page, which is not described in detail in this embodiment.
Step 202, the second thread loads a webpage according to the webpage information, and is specifically realized by executing the loading of webpage codes; and the first thread can detect the life cycle of the onprogress changed which is the loading progress change of the second thread in the process of loading the webpage.
Step 203, when the return value of the loading progress change function corresponding to the life cycle is less than 50%, determining that the second thread is before the life cycle of the currently loaded webpage, namely the onPageFinished, when the webpage loading of the currently loaded webpage is completed, and injecting the script hiding the original webpage into the life cycle of the currently loaded webpage of the second thread for execution by the first thread.
Specifically, since the web page is already displayed when the second thread runs to the lifecycle of the onPageFinished, in order to avoid the user from seeing the original web page, the first thread needs to inject a script hiding the original web page before the lifecycle of the onPageFinished.
Further, since the injection of the script to be injected needs to take effect and be executed after the second thread builds a Document Object Model (DOM) according to the webpage information, but the browser does not provide an accurate callback event, and can determine when the second thread starts building the DOM Model, the first thread can detect the onProgressChanged life cycle of the second thread, and when the return value of the onProgressChanged function is as fast as 50%, the second thread has built the DOM Model in general.
Specifically, when the script hiding the original web page is injected, the first thread repeatedly executes the code of the script hiding the original web page for multiple times, which may be specifically shown as the following code in table 1, where the maximum time interval including the time interval hiding the original web page is 4000:
TABLE 1
Figure BDA0002207253550000071
Figure BDA0002207253550000081
And 204, directly calling a WebView. evaluateJavascript function by the first thread, and injecting the script to be injected into the loaded webpage code, so that the script to be injected is executed by the second thread in the process of executing the loaded webpage code. The method comprises the steps that a Callback function is transmitted into a first thread in the process of calling a WebView.
Step 205, the first thread may directly call a webview, evaluatejavascript function, and inject the web page display script, but the Callback function called by the second thread needs to be waited to prompt that the web page display script can be injected, and the first thread injects the web page display script into the loaded web page code for the second thread to call back, so as to ensure that the second thread can execute the script to be injected, and display the updated original web page.
Specifically, since in the step 204, a Callback function is introduced during the process of calling the webview.
The first thread may be implemented by executing the code in the following table 2 when executing the step 205, where the first thread needs to wait for the return value of the Callback function of the second thread when calling the webview.
TABLE 2
Figure BDA0002207253550000082
Through the above steps 201 to 205, the first thread of the browser injects the script to be injected into the loaded webpage code for execution, and in this process, when the first thread injects the script hiding the original webpage and injects the script to be injected, the second thread displays the address of the webpage and hides the back interface (blank interface) as shown in fig. 4; after the first thread injects the webpage display script, the second thread displays the updated original webpage, and if the script to be injected is used for adding new content to the original webpage, the displayed updated original webpage comprises: content 1 and original web page content 2 are injected. Therefore, the user can only see the updated original webpage through the browser, but not the original webpage, and the condition of interface flicker is avoided.
An embodiment of the present invention further provides a web page loading terminal, a schematic structural diagram of which is shown in fig. 5, and the web page loading terminal specifically includes:
and the hidden injection unit 10 is configured to inject a script for hiding the original webpage into the life cycle of the currently loaded webpage for execution so as to hide the original webpage when it is determined that the webpage loading terminal is located before the life cycle of the currently loaded webpage for webpage loading is completed.
The hidden injection unit 10 is specifically configured to detect a life cycle of a loading progress change, and when a return value of a loading progress change function corresponding to the life cycle of the loading progress change is smaller than a preset value, determine that the web page loading terminal is located before a completion of a life cycle of a web page loading of a currently loaded web page; and when the script hiding the original webpage is injected, the method is specifically used for executing the codes of the script hiding the original webpage for multiple times, and when the return value of the loading progress change function is greater than the preset value, the execution of the codes of the script injecting the original webpage is stopped.
The code of the script for injecting the hidden original webpage comprises preset time, wherein the preset time is the maximum time interval for hiding the original webpage.
And the content injection unit 11 is configured to inject a script to be injected into the life cycle of the currently loaded web page for execution after the script for hiding the original web page is injected by the hiding injection unit 10, where the script to be injected is used to update the currently loaded original web page.
The content injection unit 11 is specifically configured to invoke a webpage script estimation function, and inject the script to be injected into a loaded webpage code, where the loaded webpage code is a code executed when the webpage is currently loaded.
And the display injection unit 12 is configured to inject a webpage display script into the life cycle of the currently loaded webpage for execution after the content injection unit 11 injects the script to be injected, where the webpage display script is used to display the updated original webpage.
The display injection unit 12 is specifically configured to, when the content injection unit 11 injects the script to be injected, transfer a callback function for the thread of loading a web page code to execute, call a web page script estimation function, and when waiting for the thread of loading the web page code to execute the callback function, inject the web page display script into the loaded web page code, where the loaded web page code is a code executed when the web page is currently loaded.
It can be seen that, in the web page loading terminal of this embodiment, the hidden injection unit 10 injects the script hiding the original web page into the life cycle of the currently loaded web page for execution before the life cycle of the currently loaded web page is completed, then the content injection unit 11 injects the script to be injected, which updates the original web page, into the life cycle for execution, and finally the display injection unit 12 injects the web page display script into the life cycle for execution. Therefore, the webpage loading terminal can hide the original webpage firstly in the webpage loading process, then execute the content of the script to be injected and finally display the updated original webpage, so that the updated original webpage can not be displayed after the original webpage is displayed under the condition that the original webpage needs to be updated, the updated original webpage can only be directly displayed, and the webpage display can not flicker.
The present invention further provides a terminal device, a schematic structural diagram of which is shown in fig. 6, where the terminal device may generate a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 20 (e.g., one or more processors) and a memory 21, and one or more storage media 22 (e.g., one or more mass storage devices) storing the application programs 221 or the data 222. Wherein the memory 21 and the storage medium 22 may be a transient storage or a persistent storage. The program stored in the storage medium 22 may include one or more modules (not shown), each of which may include a series of instruction operations for the terminal device. Still further, the central processor 20 may be arranged to communicate with the storage medium 22, and to execute a series of instruction operations in the storage medium 22 on the terminal device.
Specifically, the application 221 stored in the storage medium 22 includes a web page loading application, and the application may include the hidden injection unit 10, the content injection unit 11, and the display injection unit 12 in the web page loading terminal, which is not described herein again. Further, the central processor 20 may be configured to communicate with the storage medium 22, and execute a series of operations corresponding to the application program loaded on the web page stored in the storage medium 22 on the terminal device.
The terminal equipment may also include one or more power supplies 23, one or more wired or wireless network interfaces 24, one or more input-output interfaces 25, and/or one or more operating systems 223, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, and the like.
The steps executed by the web page loading terminal in the above method embodiment may be based on the structure of the terminal device shown in fig. 6.
The embodiment of the invention also provides a storage medium, wherein the storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by the processor and executing the webpage loading method executed by the webpage loading terminal.
The embodiment of the invention also provides terminal equipment, which comprises a processor and a storage medium, wherein the processor is used for realizing each instruction; the storage medium is used for storing a plurality of instructions, and the instructions are used for loading and executing the webpage loading method executed by the webpage loading terminal by the processor.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
The web page loading method, the web page loading device, the storage medium and the terminal device provided by the embodiment of the invention are described in detail, a specific example is applied in the description to explain the principle and the implementation of the invention, and the description of the embodiment is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A webpage loading method is characterized by comprising the following steps:
when the webpage loading terminal is determined to be positioned before the life cycle of the webpage loading of the current loaded webpage is completed, injecting a script hiding the original webpage into the life cycle of the current loaded webpage for execution so as to hide the original webpage;
injecting a script to be injected into the life cycle of the currently loaded webpage for execution, wherein the script to be injected is used for updating the currently loaded original webpage;
and injecting a webpage display script into the life cycle of the currently loaded webpage for execution, wherein the webpage display script is used for displaying the updated original webpage.
2. The method according to claim 1, wherein the determining that the web page loading terminal is located before the completion of the life cycle of the web page loading of the currently loaded web page specifically comprises:
and detecting the life cycle of the loading progress change, and when the return value of the loading progress change function corresponding to the life cycle of the loading progress change is smaller than a preset value, determining that the webpage loading terminal is positioned before the webpage loading of the currently loaded webpage completes the life cycle.
3. The method of claim 2, wherein the injecting the script hiding the original webpage into the life cycle of the currently loaded webpage for execution comprises:
executing the code of the script for hiding the original webpage for multiple times;
and when the return value of the loading progress change function is greater than the preset value, stopping executing the codes of the script for injecting the hidden original webpage.
4. The method of claim 3, wherein the code injected into the script hiding the original web page comprises a preset time, the preset time being a maximum time interval for hiding the original web page.
5. The method according to any one of claims 1 to 4, wherein the injecting the script to be injected into the lifecycle of the currently loaded web page is performed, specifically comprising:
and calling a webpage script estimation function, and injecting the script to be injected into a loaded webpage code, wherein the loaded webpage code is a code executed when the webpage is loaded currently.
6. The method according to any one of claims 1 to 4, wherein when the script to be injected is injected, a callback function is introduced for a thread that loads webpage code to execute, and then the injecting of the webpage display script into the lifecycle of the currently loaded webpage is performed, specifically including:
and calling a webpage script estimation function, and injecting the webpage display script into the loaded webpage code when waiting for the thread loading the webpage code to execute the callback function, wherein the loaded webpage code is the code executed when the webpage is loaded currently.
7. A web page loading terminal, comprising:
the hidden injection unit is used for injecting a script for hiding the original webpage into the life cycle of the currently loaded webpage for execution so as to hide the original webpage when the webpage loading terminal is determined to be positioned before the life cycle of the currently loaded webpage for loading the webpage is completed;
the content injection unit is used for injecting a script to be injected into the life cycle of the currently loaded webpage for execution, and the script to be injected is used for updating the currently loaded original webpage;
and the display injection unit is used for injecting a webpage display script into the life cycle of the currently loaded webpage for execution, and the webpage display script is used for displaying the updated original webpage.
8. The method according to claim 7, wherein the hidden injection unit is specifically configured to detect a life cycle of the loading progress change, and when a return value of a loading progress change function corresponding to the life cycle of the loading progress change is smaller than a preset value, it is determined that the web page loading terminal is located before a completion of the life cycle of the web page loading of the currently loaded web page.
9. A storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the web page loading method according to any one of claims 1 to 6.
10. A terminal device comprising a processor and a storage medium, the processor configured to implement instructions;
the storage medium is used for storing a plurality of instructions for loading and executing the web page loading method according to any one of claims 1 to 6 by a processor.
CN201910885751.9A 2019-09-19 2019-09-19 Webpage loading method and device, storage medium and terminal equipment Pending CN110704125A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910885751.9A CN110704125A (en) 2019-09-19 2019-09-19 Webpage loading method and device, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910885751.9A CN110704125A (en) 2019-09-19 2019-09-19 Webpage loading method and device, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN110704125A true CN110704125A (en) 2020-01-17

Family

ID=69194629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910885751.9A Pending CN110704125A (en) 2019-09-19 2019-09-19 Webpage loading method and device, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN110704125A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783079A (en) * 2004-11-30 2006-06-07 阿尔卡特公司 Method of displaying data of a client computer
CN104346403A (en) * 2013-08-07 2015-02-11 腾讯科技(深圳)有限公司 Browser page display method and device as well as browser and terminal
CN106202072A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 The method and apparatus that display content is provided
CN106325948A (en) * 2016-08-27 2017-01-11 飞天诚信科技股份有限公司 Method and device for supporting existing Web applications through mobile platform
CN107122192A (en) * 2017-04-27 2017-09-01 北京三快在线科技有限公司 Webpage view methods of exhibiting, device, computing device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1783079A (en) * 2004-11-30 2006-06-07 阿尔卡特公司 Method of displaying data of a client computer
CN104346403A (en) * 2013-08-07 2015-02-11 腾讯科技(深圳)有限公司 Browser page display method and device as well as browser and terminal
CN106202072A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 The method and apparatus that display content is provided
CN106325948A (en) * 2016-08-27 2017-01-11 飞天诚信科技股份有限公司 Method and device for supporting existing Web applications through mobile platform
CN107122192A (en) * 2017-04-27 2017-09-01 北京三快在线科技有限公司 Webpage view methods of exhibiting, device, computing device and storage medium

Similar Documents

Publication Publication Date Title
CN110020323B (en) Page switching method and system for hybrid application, computer equipment and storage medium
WO2017196635A1 (en) Page component dynamic layout
CN109361948B (en) Interface management method, intelligent terminal and readable storage medium
CN107015801B (en) Webpage display method and application terminal
CN109901881B (en) Plug-in loading method and device of application program, computer equipment and storage medium
WO2019085598A1 (en) Method and apparatus for calculating above-the-fold rendering duration of page, and electronic device
CN106470360B (en) Video player calling method and device
CN109522500B (en) Webpage display method, device, terminal and storage medium
US10768947B2 (en) Method for interface refresh synchronization,terminal device, and non-transitory computer-readable storage medium
CN107797922B (en) Application page testing method, electronic device and electronic equipment
US11675479B2 (en) List display method and apparatus, computer device and computer-readable medium
CN115309516A (en) Application life cycle detection method and device and computer equipment
CN111666199B (en) Debugging method executed on intelligent terminal and software debugger
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN112148395A (en) Page display method, device, equipment and storage medium
CN108268298B (en) Desktop icon generation method and device, storage medium and electronic equipment
CN110704125A (en) Webpage loading method and device, storage medium and terminal equipment
CN116150536A (en) Page returning method, device, equipment and medium
CN107103099B (en) Browser homepage returning method and device
CN113590052B (en) Information storage method, device, equipment and storage medium
CN106407016B (en) Method and device for simulating multithreading contention and robbery of resources
CN110704157B (en) Application starting method, related device and medium
CN110704247B (en) Processing method and device for application memory exception, electronic equipment and device
CN109491771B (en) Task processing method based on system performance optimization and related equipment
CN107092485B (en) Tab label dynamic updating method and device

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