Unlock instant, AI-driven research and patent intelligence for your innovation.

Method and device for dynamically modifying code of page and storage medium

A page code and page technology, applied in special data processing applications, website content management, instruments, etc., can solve problems such as coverage of customized functions, affecting the use of customized functions, and affecting the normal use of network disks

Active Publication Date: 2022-01-28
天津联想协同科技有限公司
View PDF3 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, no matter which of these two solutions is used, when installing and updating the patch on the network disk, it may cause coverage of customized functions, affect the use of customized functions, and even affect the normal use of the network disk.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for dynamically modifying code of page and storage medium
  • Method and device for dynamically modifying code of page and storage medium
  • Method and device for dynamically modifying code of page and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0033] In Embodiment 1, the present invention mainly proposes a method for dynamically modifying page codes for the newly added customization function of the browser page of the network disk. The method is proposed based on the DOM rendering process of the network disk page. The page DOM rendering process is as follows: figure 1 As shown, the specific explanation is as follows:

[0034] HTML Parser: HTML parsing;

[0035] DOM Tree: The browser parses HTML into a tree-shaped data structure;

[0036] CSS Parser: style analysis;

[0037] Style Rules: The browser parses CSS into a tree-shaped data structure, namely CSSOM;

[0038] Attachment: Use DOM Tree and Style Rules to build Render Tree;

[0039] Render Tree: Render tree, through which you can know the visible nodes and style information contained in the web page;

[0040] Layout: calculate the geometric information of the nodes according to the generated rendering tree;

[0041] Painting: According to the geometric info...

Embodiment 2

[0049] Embodiment 2 provides specific method steps for step S1 in Embodiment 1, that is, monitoring the life cycle of page DOM rendering, such as image 3 shown, including:

[0050] S101. Use the MutationObserver interface of the browser to monitor the changes in DOM rendering of the page;

[0051] The parameter of the browser MutationObserver interface is a callback function, which will be executed after the specified DOM node sends a change, and will be passed in two parameters, one is the change record array, and the other is the observer object itself, so its monitoring operation and The corresponding processing is executed asynchronously after the execution of other scripts is completed, and after all changes are triggered, the changes are recorded in the array and callbacks are performed uniformly.

[0052] S102. Observing the state of the DOM node tree by using the observer pattern.

[0053] Observer mode is also called publish-subscribe mode. This is a one-to-many o...

Embodiment 3

[0057]Embodiment 3 provides specific method steps for step S2 in Embodiment 1, that is, code injection, such as Figure 4 shown, including:

[0058] S201. Setting trigger logic and injection logic of the source code of the custom function in advance;

[0059] The trigger logic is the trigger function logic that triggers the injection of the source code of the customized function. The injection logic is the specific way of injecting the source code of the customized function. The above logic needs to be preset in the page code in advance.

[0060] S202. The trigger logic is to capture the completion of the DOM node tree rendering;

[0061] The triggering logic is combined with the specific method of monitoring the life cycle of the DOM rendering of the page in the second embodiment, capturing the completion of rendering of the DOM node tree and triggering the custom function source code injection.

[0062] S203. The injection logic is to obtain the context of the injected nod...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a method and device for dynamically modifying the code of a page. The page is a network disk page. When the network disk page is opened through a browser, the life cycle of page DOM rendering is monitored; and code injection is performed on life cycle nodes rendered by a DOM node tree in the life cycle of page DOM rendering, and a source code of a customized function is loaded to the current page. According to the method, a source code of a standard function of the network disk does not need to be modified when the standard function of the network disk is customized and developed, the customized function cannot be covered when the network disk installs and updates patches, normal use of the network disk is prevented from being affected, and a non-perception effect can be achieved by adding a customized function to the network disk.

Description

technical field [0001] The invention belongs to the technical field of network disk development, and in particular relates to a method, device and storage medium for dynamically modifying page codes. Background technique [0002] When the standard functions of the network disk cannot meet the needs of customers, it is necessary to develop customized functions for customers on the basis of the original functions of the network disk. Since the network disk provides services in the form of browser pages, there are currently two methods for custom function development. One is to use the js native language to develop pages, which need to be used to add custom function codes in the source files, and then use The patch patch method covers the modified source files. Another page function developed using the virtual DOM technology framework (such as the vue framework) needs to be repackaged and edited after the function is developed on the basis of the framework source code, and all ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/656G06F16/958
CPCG06F8/656G06F16/986
Inventor 鲁健
Owner 天津联想协同科技有限公司
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More