CN109960769B - Webpage view display method and device, computer equipment and storage medium - Google Patents
Webpage view display method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN109960769B CN109960769B CN201910196199.2A CN201910196199A CN109960769B CN 109960769 B CN109960769 B CN 109960769B CN 201910196199 A CN201910196199 A CN 201910196199A CN 109960769 B CN109960769 B CN 109960769B
- Authority
- CN
- China
- Prior art keywords
- view
- current
- state
- webpage
- webpage view
- 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
- 238000000034 method Methods 0.000 title claims abstract description 81
- 238000009877 rendering Methods 0.000 claims abstract description 41
- 238000004590 computer program Methods 0.000 claims description 24
- 238000001514 detection method Methods 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000011800 void material Substances 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application relates to a method and a device for displaying a webpage view, computer equipment and a storage medium. The method comprises the following steps: receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state. By adopting the method, the condition of reloading failure or slow operation system operation efficiency caused by reloading the webpage view immediately after the rendering process of the webpage view is terminated can be reduced, the consumption of memory is reduced, and the reloading efficiency of the webpage view is improved.
Description
Technical Field
The present application relates to the field of web page display technologies, and in particular, to a method and an apparatus for displaying a web page view, a computer device, and a storage medium.
Background
A web page view (WebView) is a control that an operating system has for loading a display web page.
In some operating systems, when the device memory of the operating system is insufficient, the operating system may reclaim the memory, and in the process of reclaiming the memory, the page rendering process of the web page view may be terminated, resulting in a blank page display of the corresponding application program.
In the conventional solution, when it is monitored that the page rendering process of the web view is terminated, the terminated web view is reloaded to restore the display page, but the reloading operation also occupies a memory, which may cause reloading failure or reduce the operating efficiency of the operating system, and has a defect of low reloading efficiency.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a method, an apparatus, a computer device, and a storage medium for displaying a web view that can efficiently resume displaying a terminated web view page.
A method for displaying a webpage view comprises the following steps:
receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state.
In one embodiment, after detecting the display state of the current webpage view, the method further includes: and if the current webpage view is in the displaying state, reloading the webpage view.
In one embodiment, if the current web page view is in the non-display state, waiting until the current web page view is switched to the display state, reloading the web page view, including: if the current webpage view is in an undisplayed state, assigning the reloading flag quantity to be a first value; when the situation that the webpage view is switched to the displaying state is monitored, reading the value of the reloading mark quantity; and if the reloading mark quantity value is read to be the first value, reloading the webpage view, and assigning the reloading mark quantity value to be the second value.
In one embodiment, detecting a display state of a current web page view includes: detecting whether an application program corresponding to the current webpage view is in an active state; detecting whether a view controller currently containing a webpage view is positioned at the top of a view controller stack; if the current application program is in an active state and the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is in a displaying state; if the current application is not in an active state or the current view controller is not at the top of the view controller stack, then it is determined that the current web page view is in an undisplayed state.
In one embodiment, the switching of the current web page view to the displaying state includes: when the application program corresponding to the current webpage view is not in an active state, monitoring the active state of the application program; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
In one embodiment, the switching of the current web page view to the displaying state includes: when the application program corresponding to the current webpage view is in an active state and the view controller containing the webpage view is not positioned at the top of the view controller stack, when the view controller of the webpage view is monitored to be positioned at the top of the view controller stack, the webpage view is determined to be switched to a displaying state.
In one embodiment, reloading the web page view comprises: removing the webpage view with the rendering process terminated from a view controller containing the webpage view; constructing a new webpage view in the memory, and adding the new webpage view into the view controller; and loading and displaying the new webpage view by using the view controller containing the new webpage view.
A display apparatus of a web page view, the apparatus comprising:
a process termination notification receiving module for receiving a notification that a rendering process of the web page view is terminated;
the display state detection module is used for detecting the display state of the current webpage view; the display state comprises a display state or a non-display state;
and the first reloading module is used for reloading the webpage view when the current webpage view is in the non-display state and the webpage view is switched to the display state.
A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state.
According to the webpage view display method, the webpage view display device, the computer equipment and the storage medium, when the notification that the rendering process of the webpage view is terminated is received, the display state of the current webpage view is detected, if the current webpage view is detected to be in the non-display state, the webpage view does not need to be reloaded immediately, and the webpage view is reloaded when the current webpage view is switched to the display state. Therefore, the condition of reloading failure or slow operation system operation efficiency caused by immediately reloading the webpage view after the rendering process of the webpage view is just terminated can be reduced, the consumption of a memory is reduced, and the reloading efficiency of the webpage view is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary embodiment of a display method for a web page view;
FIG. 2 is a flowchart illustrating a method for displaying a web page view according to an embodiment;
FIG. 3 is a flowchart illustrating a method for displaying a web page view according to another embodiment;
FIG. 4 is a block diagram of a display device for displaying a web page view according to an embodiment;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The method for displaying the webpage view provided by the application can be applied to the terminal 100 shown in fig. 1. The terminal 100 is loaded with an operating system 101 and an application program 102, when the application program 102 controls to display a page, a rendering process of a web page view is correspondingly generated, and if the memory of the operating system is insufficient and the rendering process of the web page view is terminated, the application program 102 loaded in the terminal 102 executes the method for displaying a web page view according to the embodiment of the present application, and resumes to display the terminated page. The terminal 102 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, portable wearable devices, and the like.
In an embodiment, as shown in fig. 2, a method for displaying a web page view is provided, which is described by way of example when the method is applied to an application program loaded on a terminal in fig. 1, and includes the following steps:
s202, receiving a notice that the rendering process of the webpage view is terminated;
in this step, the application program monitors the rendering process state of the current web view, and when the operating system terminates the rendering process of the web view, the application program receives a notification that the rendering process of the web view is terminated. In particular, a notification that a rendering process of a web page view is terminated may be monitored and received while an application is active, while an existing partial operating system may not be able to receive a notification that a rendering process of a web page view is terminated if the application is not active.
By way of example, taking an operating system as an Ios system as an example, the corresponding web page view is wkbwebview. In this step, the application program may monitor whether the operating system terminates (Kill) the rendering process of WKWebView through WebViewWebContentProcessDidTerminate. Specifically, whether the rendering process of the wkpeview is terminated by the operating system can be determined by determining whether the wkpeview.
S204, detecting the display state of the current webpage view; wherein the display state comprises a display state or a non-display state; if the current webpage view is in the non-display state, executing S206;
in this step, after receiving the notification that the rendering process of the web page view is terminated, the application program detects the display state of the currently terminated web page view. If the rendering process of the current webpage view is not terminated, the loaded page corresponding to the webpage view can be seen by the user, and the current webpage view is in the displaying state, and if the rendering process of the current webpage view is not terminated, the loaded page corresponding to the webpage view cannot be seen by the user, for example, under the conditions of background hiding of a program and the like, the current webpage view is in the non-displaying state.
S206, when the current webpage view is switched to the displaying state, the webpage view is reloaded.
In this step, if the current web page view is in the non-display state, the application program does not immediately reload the web page view, but can record that the current web page view needs reloading, and reload the web page view when waiting for monitoring that the current web page view is switched from the non-display state to the display state.
According to the webpage view display method, when the notification that the rendering process of the webpage view is terminated is received, the display state of the current webpage view is detected, if the current webpage view is detected to be in the non-display state, the webpage view does not need to be reloaded immediately, and the webpage view is reloaded when the current webpage view is switched to the display state. Therefore, the condition of reloading failure or slow operation system operation efficiency caused by immediately reloading the webpage view after the rendering process of the webpage view is just terminated can be reduced, the consumption of a memory is reduced, and the reloading efficiency of the webpage view is improved.
In one embodiment, as shown in fig. 3, after detecting the display state of the current web page view, the method further includes: if the current webpage view is in the displaying state, executing S208;
and S208, reloading the webpage view.
In this embodiment, when a notification that the rendering process of the web page view is terminated is received, if the current web page view is in the displaying state, it is described that if the web page view is not reloaded in time at this time, a situation that the page display is blank occurs, the web page view is directly reloaded, so as to recover the display content of the web page as soon as possible, and reduce the situation that the page is blank.
In one embodiment, if the current web page view is in the non-display state, executing S206, and waiting until the current web page view is switched to the display state, reloading the web page view, including: if the current webpage view is in an undisplayed state, assigning the reloading flag quantity to be a first value; when the situation that the webpage view is switched to the displaying state is monitored, reading the value of the reloading mark quantity; and if the reloading mark quantity value is read to be the first value, reloading the webpage view, and assigning the reloading mark quantity value to be the second value.
For example, the reload flag may be a Boolean (BOOL) variable, when the value of the variable is true, the rendering process representing the web page view is closed by the operating system, and the display page of the web page view needs to be reloaded the next time the web page view switches to the displaying state. When the variable is assigned to false, the web page view is switched to the displaying state without reloading the display page of the web page view.
In this embodiment, each time the terminal receives a notification that the web page view is terminated and the web page view is in an undisplayed state, the terminal assigns a reload flag to a first value to record that the currently terminated web page view needs to be reloaded. In this way, when the terminal monitors that the webpage view is switched from the non-display state to the display state every time, the operation of reading the reloading mark amount is executed once, and if the read reloading mark amount is a first value, the webpage view which is being displayed is reloaded; and if the read reloading flag quantity is a second value, the process of rendering the webpage view is not terminated at the moment, and the webpage view which is being displayed does not need to be reloaded. Therefore, efficient recording of whether the webpage needs to be reloaded is achieved, memory occupation caused by reloading of the webpage view under unnecessary conditions is avoided, and operation efficiency is improved.
In one embodiment, detecting a display state of a current web page view includes: detecting whether an application program corresponding to the current webpage view is in an active state; detecting whether a view controller currently containing a webpage view is positioned at the top of a view controller stack; if the current application program is in an active state and the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is in a displaying state; if the current application is not in an active state or the current view controller is not at the top of the view controller stack, then it is determined that the current web page view is in an undisplayed state.
The active state of the application program may include two types, one is in an active state, for example, the application program is in the process of being started and used by a user; the other is not in an active state, for example, when the user presses the home key of the terminal, or receives a call, turns on the control center, or the like. If the application is detected not to be in the active state, it may be determined that the web page view of the application is in the non-displayed state at that time, and if the application is in the active state, further determination may be required based on the position of the view controller containing the web page view in the view controller stack.
For example, for an Ios operating system, it may be determined that a current application is in an active state when [ uiapplicationshared application ]. applicationState ═ uiapplicationstate active is detected. And may determine that the view controller currently containing the web page view is located at the top of the view controller stack when a self.
In this embodiment, the display state of the current web page view can be determined quickly and accurately according to the active state of the web page view and the position of the view controller containing the web page view in the view controller stack.
In one embodiment, the switching of the current web page view to the displaying state includes: when the application program corresponding to the current webpage view is not in an active state, monitoring the active state of the application program; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
Taking the Ios operating system as an example, when it is monitored that the uiapplicationdigbecomeactivenotification is notified that the application program returns from the inactive state to the active state, it may be determined that the application program is switched from the inactive state to the active state.
In this embodiment, when the application program corresponding to the current web view is not in the active state and it is to be monitored that the application program is switched to the active state, it is determined that the current web view is switched to the displaying state when the view controller currently including the web view is located at the top of the view controller stack. Therefore, the current webpage view can be quickly and accurately determined to be switched to the displaying state.
In one embodiment, the switching of the current web page view to the displaying state includes: when the application program corresponding to the current webpage view is in an active state and the view controller containing the webpage view is not positioned at the top of the view controller stack, when the view controller of the webpage view is monitored to be positioned at the top of the view controller stack, the webpage view is determined to be switched to a displaying state.
Taking the Ios operating system as an example, when an application program corresponding to a web page view is in an active state, and when a user operates to enable a view controller containing the web page view to reach the top of a view controller stack, responding to the life cycle of the view controller: - (void) viewDidAppear (BOOL) animated, the web page view may be switched to the displaying state.
In this embodiment, when the application corresponding to the current web page view is in an active state, it is determined that the web page view is switched to the displaying state when the view controller of the web page view is located at the top of the view controller stack. Therefore, the current webpage view can be quickly and accurately determined to be switched to the displaying state.
In one embodiment, reloading the web page view comprises: removing the webpage view with the rendering process terminated from a view controller containing the webpage view; constructing a new webpage view in the memory, and adding the new webpage view into the view controller; and loading and displaying the new webpage view by using the view controller containing the new webpage view. Wherein the constructed new webpage view corresponds to the same display page as the terminated webpage view.
For example, in the Ios operating system, the new web page view may be displayed according to url load [ WKWebView loadRequest ] load.
When the webpage view is reloaded, an alternative scheme is to Reload the terminated webpage view, for example, in an Ios system, the terminated webpage view can be reloaded by calling a Reload method of wkbwebview. In the embodiment, the terminated webpage view is not loaded, but the terminated webpage view is completely removed, and a new webpage view is constructed and loaded, so that memory leakage can be avoided, and the success rate of reloading is improved.
It should be understood that although the various steps in the flow charts of fig. 2-3 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-3 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 4, there is provided a display apparatus 400 of a web page view, including: a process termination notification receiving module 402, a display status detecting module 404, and a first reloading module 406, wherein:
a process termination notification receiving module 402 for receiving a notification that a rendering process of the web page view is terminated;
a display state detection module 404, configured to detect a display state of a current web page view; the display state comprises a display state or a non-display state;
the first reloading module 406 is configured to, if the current web page view is in the undisplayed state, reload the web page view when waiting for the web page view to be switched to the displaying state.
In one embodiment, the apparatus 400 for displaying a web page view further includes: and the second reloading module is used for reloading the webpage view if the current webpage view is in the displaying state.
In one embodiment, the first reload module 406 comprises:
the first flag quantity assignment module is used for assigning the reloading flag quantity to be a first value if the current webpage view is in an undisplayed state;
the mark quantity reading module is used for reading the value of the reloading mark quantity when the condition that the webpage view is switched to the displaying state is monitored;
and the second flag quantity assignment module is used for reloading the webpage view and assigning the reloading flag quantity to a second value if the reloading flag quantity is read to be the first value.
In one embodiment, the display status detection module 404 includes:
the application program state detection module is used for detecting whether the application program corresponding to the current webpage view is in an active state;
the view controller position detection module is used for detecting whether a view controller currently containing the webpage view is positioned at the top of the view controller stack;
a display state determining module, configured to determine that the current web page view is in a display state if the current application program is in an active state and the current view controller is located at the top of the view controller stack;
and the non-display state determining module is used for determining that the current webpage view is in a non-display state if the current application program is not in an active state or the current view controller is not positioned at the top of the view controller stack.
In one embodiment, the first reload module 406 is configured to monitor an active state of the application program when the application program corresponding to the current web page view is not in the active state; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
In one embodiment, the first reload module 406 is configured to determine that the web page view is switched to the displaying state when it is detected that the view controller of the web page view is located at the top of the view controller stack when the application corresponding to the current web page view is in the active state and the view controller containing the web page view is not located at the top of the view controller stack.
In one embodiment, the first reload module 406 is configured to remove the webpage view from the view controller containing the webpage view, where the rendering process is terminated; constructing a new webpage view in the memory, and adding the new webpage view into the view controller; and loading and displaying the new webpage view by using the view controller containing the new webpage view.
For specific limitations of the display device of the web page view, reference may be made to the above limitations on the display method of the web page view, and details are not described herein again. The modules in the display device of the web page view may be wholly or partially implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of displaying a web page view. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
and if the current webpage view is in the displaying state, reloading the webpage view.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
if the current webpage view is in an undisplayed state, assigning the reloading flag quantity to be a first value; when the situation that the webpage view is switched to the displaying state is monitored, reading the value of the reloading mark quantity; and if the reloading mark quantity value is read to be the first value, reloading the webpage view, and assigning the reloading mark quantity value to be the second value.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
detecting whether an application program corresponding to the current webpage view is in an active state; detecting whether a view controller currently containing a webpage view is positioned at the top of a view controller stack; if the current application program is in an active state and the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is in a displaying state; if the current application is not in an active state or the current view controller is not at the top of the view controller stack, then it is determined that the current web page view is in an undisplayed state.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the application program corresponding to the current webpage view is not in an active state, monitoring the active state of the application program; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
when the application program corresponding to the current webpage view is in an active state and the view controller containing the webpage view is not positioned at the top of the view controller stack, when the view controller of the webpage view is monitored to be positioned at the top of the view controller stack, the webpage view is determined to be switched to a displaying state.
In one embodiment, reloading the web page view comprises: removing the webpage view with the rendering process terminated from a view controller containing the webpage view; constructing a new webpage view in the memory, and adding the new webpage view into the view controller; and loading and displaying the new webpage view by using the view controller containing the new webpage view.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
receiving a notification that a rendering process of a web page view is terminated; detecting the display state of the current webpage view; the display state comprises a display state or a non-display state; and if the current webpage view is in the non-display state, reloading the webpage view when the current webpage view is switched to the display state.
In one embodiment, the computer program when executed by the processor further performs the steps of:
and if the current webpage view is in the displaying state, reloading the webpage view.
In one embodiment, the computer program when executed by the processor further performs the steps of:
if the current webpage view is in an undisplayed state, assigning the reloading flag quantity to be a first value; when the situation that the webpage view is switched to the displaying state is monitored, reading the value of the reloading mark quantity; and if the reloading mark quantity value is read to be the first value, reloading the webpage view, and assigning the reloading mark quantity value to be the second value.
In one embodiment, the computer program when executed by the processor further performs the steps of:
detecting whether an application program corresponding to the current webpage view is in an active state; detecting whether a view controller currently containing a webpage view is positioned at the top of a view controller stack; if the current application program is in an active state and the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is in a displaying state; if the current application is not in an active state or the current view controller is not at the top of the view controller stack, then it is determined that the current web page view is in an undisplayed state.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the application program corresponding to the current webpage view is not in an active state, monitoring the active state of the application program; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
In one embodiment, the computer program when executed by the processor further performs the steps of:
when the application program corresponding to the current webpage view is in an active state and the view controller containing the webpage view is not positioned at the top of the view controller stack, when the view controller of the webpage view is monitored to be positioned at the top of the view controller stack, the webpage view is determined to be switched to a displaying state.
In one embodiment, the computer program when executed by the processor further performs the steps of:
removing the webpage view with the rendering process terminated from a view controller containing the webpage view; constructing a new webpage view in the memory, and adding the new webpage view into the view controller; and loading and displaying the new webpage view by using the view controller containing the new webpage view.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (11)
1. A method of displaying a web page view, the method comprising:
receiving a notification that the rendering process of the web page view is terminated when the operating system terminates the rendering process of the web page view;
detecting the display state of the current webpage view; the display state comprises a display state or a non-display state;
if the current webpage view is in the non-display state, the webpage view is reloaded when the current webpage view is switched to the display state;
the detecting the display state of the current webpage view comprises the following steps:
detecting whether an application program corresponding to the current webpage view is in an active state;
detecting whether a view controller currently containing the webpage view is positioned at the top of a view controller stack;
if the current application program is in an active state and the current view controller is positioned at the top of a view controller stack, determining that the current webpage view is in a displaying state;
if the current application program is not in an active state or the current view controller is not positioned at the top of a view controller stack, determining that the current webpage view is in an undisplayed state;
if the current webpage view is in the non-display state, when the current webpage view is switched to the display state, reloading the webpage view, wherein the reloading comprises the following steps:
if the current webpage view is in an undisplayed state, assigning the reloading flag quantity to be a first value;
when the current webpage view is monitored to be switched to the displaying state, reading the value of the reloading mark quantity;
and if the reloading mark quantity value is read to be a first value, reloading the webpage view, and assigning the reloading mark quantity value to be a second value.
2. The method of claim 1, wherein after detecting the display status of the current webpage view, further comprising:
and if the current webpage view is in the displaying state, reloading the webpage view.
3. The method of claim 1 or 2, wherein switching the current webpage view to the displaying state comprises:
when the application program corresponding to the current webpage view is not in an active state, monitoring the active state of the application program;
if the application program is monitored to be switched from the inactive state to the active state, detecting whether a view controller currently containing the webpage view is positioned at the top of a view controller stack;
and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
4. The method of claim 1 or 2, wherein switching the current webpage view to the displaying state comprises:
when the application program corresponding to the current webpage view is in an active state and the view controller containing the webpage view is not positioned at the top of the view controller stack, determining that the webpage view is switched to a displaying state when the view controller of the webpage view is monitored to be positioned at the top of the view controller stack.
5. The method of claim 1 or 2, wherein the reloading the web page view comprises:
removing the webpage view with the rendering process terminated from a view controller containing the webpage view;
constructing a new webpage view in the memory, and adding the new webpage view into the view controller;
and loading and displaying the new webpage view by using the view controller containing the new webpage view.
6. An apparatus for displaying a web page view, the apparatus comprising:
a process termination notification receiving module, configured to receive a notification that a rendering process of the web page view is terminated when the operating system terminates the rendering process of the web page view;
the display state detection module is used for detecting the display state of the current webpage view; the display state comprises a display state or a non-display state;
the first reloading module is used for reloading the webpage view when the current webpage view is in the non-display state and the webpage view is switched to the display state;
wherein, the display state detection module includes:
the application program state detection module is used for detecting whether the application program corresponding to the current webpage view is in an active state;
the view controller position detection module is used for detecting whether a view controller currently containing the webpage view is positioned at the top of the view controller stack;
a display state determining module, configured to determine that the current web page view is in a display state if the current application program is in an active state and the current view controller is located at the top of the view controller stack;
the non-display state determining module is used for determining that the current webpage view is in a non-display state if the current application program is not in an active state or the current view controller is not positioned at the top of the view controller stack;
the first reload module comprises:
the first flag quantity assignment module is used for assigning the reloading flag quantity to be a first value if the current webpage view is in an undisplayed state;
the mark quantity reading module is used for reading the value of the reloading mark quantity when the condition that the current webpage view is switched to the display state is monitored;
and the second flag quantity assignment module is used for reloading the webpage view and assigning the reloading flag quantity to a second value if the reloading flag quantity is read to be the first value.
7. The apparatus of claim 6, further comprising:
and the second reloading module is used for reloading the webpage view if the current webpage view is in the displaying state.
8. The apparatus according to claim 6, wherein the first reload module is configured to monitor an active state of the application program when the application program corresponding to the current web page view is not in the active state; if the situation that the application program is switched from the inactive state to the active state is monitored, whether a view controller containing the webpage view is located at the top of a view controller stack or not is detected; and if the current view controller is positioned at the top of the view controller stack, determining that the current webpage view is switched to the displaying state.
9. The apparatus of claim 6, wherein the first reload module is configured to determine that the web page view is switched to the displaying state when it is detected that the view controller of the web page view is located at the top of the view controller stack when the application corresponding to the current web page view is in an active state and the view controller containing the web page view is not located at the top of the view controller stack.
10. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 5 when executing the computer program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910196199.2A CN109960769B (en) | 2019-03-15 | 2019-03-15 | Webpage view display method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910196199.2A CN109960769B (en) | 2019-03-15 | 2019-03-15 | Webpage view display method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109960769A CN109960769A (en) | 2019-07-02 |
CN109960769B true CN109960769B (en) | 2021-08-31 |
Family
ID=67024448
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910196199.2A Active CN109960769B (en) | 2019-03-15 | 2019-03-15 | Webpage view display method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109960769B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101763432A (en) * | 2010-01-05 | 2010-06-30 | 北京大学 | Method for constructing lightweight webpage dynamic view |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080294974A1 (en) * | 2007-05-24 | 2008-11-27 | Nokia Corporation | Webpage history view |
KR101685145B1 (en) * | 2010-06-09 | 2016-12-09 | 엘지전자 주식회사 | Mobile terminal and control method thereof |
US8756500B2 (en) * | 2011-09-20 | 2014-06-17 | Microsoft Corporation | Dynamic content feed filtering |
CN103942231B (en) * | 2013-01-18 | 2019-01-15 | 联想(北京)有限公司 | A kind of display methods and electronic equipment of webpage |
US9294538B1 (en) * | 2013-02-12 | 2016-03-22 | Amazon Technologies, Inc. | Dynamic content injection |
CN105630267B (en) * | 2014-10-29 | 2019-04-12 | 阿里巴巴集团控股有限公司 | View interface method for managing resource and device |
CN105653586A (en) * | 2015-12-21 | 2016-06-08 | 北京奇虎科技有限公司 | Method and device for switching webpages in browser labels |
-
2019
- 2019-03-15 CN CN201910196199.2A patent/CN109960769B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101763432A (en) * | 2010-01-05 | 2010-06-30 | 北京大学 | Method for constructing lightweight webpage dynamic view |
Also Published As
Publication number | Publication date |
---|---|
CN109960769A (en) | 2019-07-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110008455B (en) | Table editing method, apparatus, computer device and storage medium | |
CN108848142B (en) | Message pushing method and device, computer equipment and storage medium | |
CN109325349A (en) | A kind of method for managing security, terminal device and computer readable storage medium | |
CN109669877B (en) | Memory management method, device, terminal and storage medium | |
CN110990132B (en) | Asynchronous task processing method and device, computer equipment and storage medium | |
CN113392037B (en) | Memory recycling method, memory recycling device, computer equipment and storage medium | |
CN110472168A (en) | Page data update method, device, computer equipment and storage medium | |
CN110908837A (en) | Application program exception handling method and device, electronic equipment and storage medium | |
CN110908866A (en) | Software monitoring method and related equipment | |
CN110597815A (en) | Service processing method, device, computer equipment and storage medium | |
CN109960769B (en) | Webpage view display method and device, computer equipment and storage medium | |
CN115454512A (en) | Chip drive loading configuration method, device, equipment and storage medium | |
CN111400087B (en) | Control method of operating system, terminal and storage medium | |
CN109388511B (en) | Information processing method, electronic equipment and computer storage medium | |
CN107577611A (en) | Using debugging apparatus and method | |
CN111880945B (en) | Shared device information processing method, system, device, computer and storage medium | |
EP1971920A2 (en) | Method and apparatus for dumping a process memory space | |
CN106293796B (en) | A kind of information processing method and electronic equipment | |
CN111158819B (en) | Interface state determining method, device, equipment and storage medium | |
CN115617515A (en) | Memory allocation method and device for intelligent Internet of things operating system and storage medium | |
CN110704247B (en) | Processing method and device for application memory exception, electronic equipment and device | |
CN110879757B (en) | Restarting method and device for abnormal operation of client and computer equipment | |
CN109189273B (en) | Touch event processing method and device, computer equipment and storage medium | |
CN111177603A (en) | Traffic-saving management and control method, system, computer equipment and storage medium | |
CN112303811A (en) | Processing method, device and system for air conditioner operation data, air conditioner and storage medium |
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 |