CN113760706A - Webpage debugging method and device - Google Patents

Webpage debugging method and device Download PDF

Info

Publication number
CN113760706A
CN113760706A CN202010991501.6A CN202010991501A CN113760706A CN 113760706 A CN113760706 A CN 113760706A CN 202010991501 A CN202010991501 A CN 202010991501A CN 113760706 A CN113760706 A CN 113760706A
Authority
CN
China
Prior art keywords
file
webpage
preset
debugging
user
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.)
Granted
Application number
CN202010991501.6A
Other languages
Chinese (zh)
Other versions
CN113760706B (en
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202010991501.6A priority Critical patent/CN113760706B/en
Publication of CN113760706A publication Critical patent/CN113760706A/en
Application granted granted Critical
Publication of CN113760706B publication Critical patent/CN113760706B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3628Software debugging of optimised code
    • 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/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • G06F9/45508Runtime interpretation or emulation, e g. emulator loops, bytecode interpretation
    • G06F9/45512Command shells

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a webpage debugging method and device. One embodiment of the method comprises: loading a webpage in response to the fact that the preset operation of the user is received; in the loading process of the webpage, executing a first script file and acquiring an identifier representing whether the webpage is debugged; responding to the determined identifier as a preset debugging identifier, and executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, comprises a preset debugging library and is only disclosed to the intranet; and in the process of displaying and executing the second script file, the debugging entry obtained based on the preset debugging library is used for receiving a debugging instruction of a user to debug the webpage, so that the webpage loads the second script file in a debugging mode, the readability of webpage codes is improved, and the webpage debugging efficiency can be improved.

Description

Webpage debugging method and device
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a webpage debugging method and device.
Background
With the development of internet technology and the popularization of mobile terminal intelligence, more and more web pages or applications for mobile terminals are developed and used. However, the normal web pages in the development and test links often appear in the whole development and test links until the production links are put into production, and the production environment becomes abnormal after the web pages are actually on line. There are many reasons, such as various problems caused by different operating system platforms, operating system versions, mobile phone manufacturers, web browser kernels, application programs and server return data, and the problem web pages need to be debugged and located quickly.
Disclosure of Invention
The embodiment of the application provides a webpage debugging method and device.
In a first aspect, an embodiment of the present application provides a method for debugging a web page, including: loading a webpage in response to the fact that the preset operation of the user is received; in the loading process of the webpage, executing a first script file and acquiring an identifier representing whether the webpage is debugged; responding to the determined identifier as a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the intranet; and receiving a debugging instruction debugging webpage of a user based on a debugging entry obtained by a preset debugging library in the process of displaying and executing the second script file.
In some embodiments, the above method further comprises: and executing a third script file in response to the non-preset debugging identification, wherein the third script file is an encrypted and/or compressed original file representing the business codes of the webpage.
In some embodiments, the first script file includes preset matching information; the executing the second script file in response to determining that the identifier is the preset debugging identifier includes: in response to the fact that the identification is the preset debugging identification, acquiring information to be matched, which is input by a user at a preset terminal of the loaded webpage; and responding to the fact that the information to be matched is matched with the preset matching information, determining that the user is the user with the right of debugging the webpage, and executing the second script file.
In some embodiments, a display screen of the preset terminal is provided with a preset dot matrix; the acquiring of the information to be matched input by the user at the preset terminal for loading the webpage includes: and acquiring information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
In some embodiments, the obtaining information to be matched based on the contact information between the user and the preset point in the preset dot matrix on the display screen includes: aiming at each input operation in multiple input operations of a user on a display screen, acquiring the serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation; and determining a plurality of numbers input by the user as the information to be matched input by the user.
In some embodiments, the above method further comprises: and in response to the fact that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, before the loading the webpage in response to determining that the preset operation of the user is received, the method further includes: generating a hypertext markup language file, a script language file, a webpage picture file and a webpage style file which are required by a published webpage based on a webpage code representing the webpage, wherein the script language file comprises a first script file, a second script file and a third script file; for each file in the plurality of files, deploying the file in a corresponding service based on the file type of the file; and releasing the webpage.
In some embodiments, the deploying, for each file in the plurality of files, the file in the corresponding service based on the file type of the file includes: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying first script files, third script files and webpage style files in a first service capable of performing domain name resolution on an internal network and an external network, deploying second script files in a second service capable of performing domain name resolution on the internal network, and deploying webpage picture files in a third service capable of performing domain name resolution on the internal network and the external network.
In a second aspect, an embodiment of the present application provides a web page debugging apparatus, including: a loading unit configured to load a web page in response to determining that a preset operation by a user is received; the acquisition unit is configured to execute the first script file and acquire an identifier representing whether the webpage is debugged in the loading process of the webpage; the first execution unit is configured to execute a second script file in response to the fact that the identification is the preset debugging identification, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the intranet; and the debugging unit is configured to receive a debugging instruction debugging webpage of a user based on a debugging inlet obtained by a preset debugging library in the process of executing the second script file.
In some embodiments, the above apparatus further comprises: and the second execution unit is configured to execute a third script file in response to the determination that the identifier is the non-preset debugging identifier, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
In some embodiments, the first script file includes preset matching information; a first execution unit further configured to: in response to the fact that the identification is the preset debugging identification, acquiring information to be matched, which is input by a user at a preset terminal of the loaded webpage; and responding to the fact that the information to be matched is matched with the preset matching information, determining that the user is the user with the right of debugging the webpage, and executing the second script file.
In some embodiments, a display screen of the preset terminal is provided with a preset dot matrix; a first execution unit further configured to: and acquiring information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
In some embodiments, the first execution unit is further configured to: aiming at each input operation in multiple input operations of a user on a display screen, acquiring the serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation; and determining a plurality of numbers input by the user as the information to be matched input by the user.
In some embodiments, the above apparatus further comprises: a change unit configured to: and in response to the fact that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, the above apparatus further comprises: the webpage publishing system comprises a generating unit, a publishing unit and a display unit, wherein the generating unit is configured to generate a hypertext markup language file, a script language file, a webpage picture file and a webpage style file which are required by a published webpage based on webpage codes representing the webpage, and the script language file comprises a first script file, a second script file and a third script file; a deployment unit configured to deploy, for each of a plurality of files, the file in a corresponding service based on a file type of the file; a publishing unit configured to publish the web page.
In some embodiments, the deployment unit is further configured to: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying first script files, third script files and webpage style files in a first service capable of performing domain name resolution on an internal network and an external network, deploying second script files in a second service capable of performing domain name resolution on the internal network, and deploying webpage picture files in a third service capable of performing domain name resolution on the internal network and the external network.
In a third aspect, the present application provides a computer-readable medium, on which a computer program is stored, where the program, when executed by a processor, implements the method as described in any implementation manner of the first aspect.
In a fourth aspect, an embodiment of the present application provides an electronic device, including: one or more processors; a storage device having one or more programs stored thereon, which when executed by one or more processors, cause the one or more processors to implement a method as described in any implementation of the first aspect.
According to the webpage debugging method and device provided by the embodiment of the application, the webpage is loaded by responding to the fact that the preset operation of the user is received; in the loading process of the webpage, executing a first script file and acquiring an identifier representing whether the webpage is debugged; responding to the determined identifier as a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the intranet; in the process of executing the second script file, a debugging entry obtained based on a preset debugging library is received, and a debugging instruction of a user is received to debug the webpage, so that the uncompressed and unencrypted second script file is loaded on the webpage in a debugging mode, the readability of webpage codes is improved, and the webpage debugging efficiency can be improved; in the webpage code releasing and deploying stage, the debugging library of the debugging code is already deployed in the second script file, and when an online problem is encountered, the second script file does not need to be modified again to release the webpage again; the second script file is only disclosed for the intranet, and the safety of the webpage is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a web page debugging method according to the present application;
FIG. 3 is a schematic diagram of a predetermined lattice according to the webpage debugging method of the present application;
FIG. 4 is a schematic diagram of preset lattice characterization numbers according to the webpage debugging method of the present application;
fig. 5 is a schematic diagram of an application scenario of the web page debugging method according to the present embodiment;
FIG. 6 is a flow diagram of yet another embodiment of a web page debugging method in accordance with the present application;
FIG. 7 is a flow chart of an identified modification logic according to the present application;
FIG. 8 is a block diagram of one embodiment of a web page debugging apparatus according to the present application;
FIG. 9 is a block diagram of a computer system suitable for use in implementing embodiments of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates an exemplary architecture 100 to which the web page debugging method and apparatus of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, and 103 are hardware, they may be various electronic devices supporting network connection, information interaction, display, processing, and the like, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server that provides various services, such as a background processing server that debugs web pages loaded by the terminal devices 101, 102, 103. In the loading process of the webpage, the background processing server executes the first script file to obtain an identifier representing whether the webpage is debugged; and in response to the fact that the identification is the preset debugging identification, executing the second script file, and receiving a debugging instruction debugging webpage of the user based on a debugging inlet obtained by a preset debugging library in the process of displaying and executing the second script file on the terminal equipment. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the webpage debugging method provided by the embodiment of the present disclosure may be executed by a server, may also be executed by a terminal device, and may also be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit, sub-unit, module, sub-module) included in the web page debugging apparatus may be all disposed in the server, may be all disposed in the terminal device, and may be disposed in the server and the terminal device, respectively.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the web page debugging method is executed does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., a server or a terminal device) on which the web page debugging method is executed.
With continued reference to FIG. 2, a flow 200 of one embodiment of a web page debugging method is shown, comprising the steps of:
step 201, in response to determining that the preset operation of the user is received, loading a webpage.
In this embodiment, an execution subject (for example, a terminal device or a server in fig. 1) of the webpage debugging method may load the webpage in response to determining that the preset operation of the user is received.
The web page may be a web page carrying business contents of various website applications. As an example, the web page may be a web page showing related goods in a shopping-like application.
The web page in this embodiment generally includes the following files: hypertext markup language files, scripting language files, web page style files, and web page picture files. The hypertext markup language file comprises a series of tags, and the tags can unify the document format on the network, so that the scattered network resources are connected into a logic whole. A hypertext markup language document is descriptive text composed of hypertext markup language commands that can specify words, graphics, animations, sounds, tables, links, etc.
The script language file is generally a Javascript file and comprises a first script file, a second script file and a third script file. The first script file is used for guiding the hypertext markup language file to load a second script file or a third script file representing the business codes of the webpage. Although both the second script file and the third script file represent the business code of the web page, the second script file is an unencrypted, uncompressed original file and is only disclosed to the internal network; the third script file is a file after encryption and/or compression, and can be disclosed to an internal network and an external network.
The intranet is a local area network or a private office network where the user is located and is only accessed by equipment terminals in the local area network or the private office network; the external network is a public network, and all equipment terminals accessed to the Internet of things can access the public network.
The webpage style file is a file representing the display style of the webpage, and the webpage picture file comprises pictures related in the webpage.
Step 202, in the process of loading the web page, executing the first script file, and obtaining an identifier representing whether the web page is debugged.
In this embodiment, the execution main body executes the first script file during the loading process of the web page, and obtains an identifier indicating whether the web page is debugged.
And executing the first script file to guide the hypertext markup language file to load a second script file or a third script file representing the service code of the webpage, and loading the identifier of the second script file or the third script file representing whether the webpage is debugged according to the identifier.
As an example, the execution subject may obtain, from a local storage of a browser that loads the web page, an identifier that represents whether the web page is debugged.
And step 203, responding to the determined identifier as the preset debugging identifier, and executing the second script file.
In this embodiment, the executing entity executes the second script file in response to determining that the identifier obtained in step 202 is the preset debugging identifier.
In this embodiment, in addition to the differences between the second script file and the third script file described in step 201, the following differences exist between the two files: the second script file comprises a preset debugging library, and the third script file does not comprise the preset debugging library. The preset debugging library can provide a webpage debugging tool and support related webpage debugging instructions when the second script file is executed.
The preset debugging library may be a debugging library that provides an arbitrary webpage debugging tool. As an example, the preset debug library may be a debug library that provides a vConsole debug tool.
In some optional implementations of this embodiment, the first script file includes preset matching information; the executing main body executes the step 203 as follows:
firstly, in response to the fact that the identification is the preset debugging identification, information to be matched input by a user at a preset terminal for loading the webpage is obtained.
And then, in response to the fact that the information to be matched is matched with the preset matching information, determining that the user is a user with the right of debugging the webpage, and executing the second script file.
In this implementation, the user having the right to debug the web page may be, for example, a developer of the web page or a technician having professional web page debugging skills. Because the uncompressed and unencrypted original file of the webpage is executed in the debugging mode in which the identifier is the preset debugging identifier, that is, the webpage is debugged, in order to ensure the security of the webpage code, the authority of the user needs to be verified, and when the user has the authority to debug the webpage, the second script file can be executed.
Specifically, a preset dot matrix is arranged on a display screen of the preset terminal. The predetermined dot matrix may be a predetermined number of dot matrices having a fixed arrangement rule. By selecting the preset points at different positions in the preset dot matrix, corresponding numbers or characters can be formed. For example, as shown in fig. 3, a thirteen-dot matrix 301 is arranged around and at the center of the display screen of the preset terminal. In the thirteen dot matrixes, corresponding numbers can be formed by selecting preset points at different positions. For example, as shown in fig. 4, the thirteen lattices 401, 402, 403 represent the numbers 1, 2, 3, respectively.
The execution main body acquires information to be matched based on contact information of a user and preset points in a preset dot matrix on the display screen. The information to be matched may be a single number or character obtained based on one input operation of the user, or may be a number string or character string obtained based on multiple input operations of the user.
Specifically, the execution main body first obtains, for each input operation of the user in multiple input operations on the display screen, a sequence number of each preset point touched by the user in the input operation; then, determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation; and finally, determining a plurality of numbers input by the user as the information to be matched input by the user.
The execution main body carries out unique labeling on each preset point in the preset dot matrix, and then information input by a user can be quickly identified through the serial number of each preset point contacted in one-time input operation, so that the information identification efficiency is improved.
In this implementation manner, the execution main body records the input times of the user error in response to determining that the information to be matched is not matched with the preset matching information; and responding to the fact that the input times of the errors exceed a preset threshold value, judging that the user is a user without the right of debugging the webpage, executing a third script file, and responding to the fact that the input times of the errors do not exceed the preset threshold value, and continuously receiving the information to be matched of the user.
In some optional implementation manners of this embodiment, in response to determining that the information to be matched matches the preset matching information, the execution main body deletes the preset debugging identifier.
And 204, receiving a debugging instruction debugging webpage of a user based on a debugging entrance obtained by a preset debugging library in the process of executing the second script file.
In this embodiment, the execution main body may display a debugging entry obtained based on a preset debugging library in the process of executing the second script file, and receive a debugging instruction debugging webpage of a user.
As an example, the third script file first executes the rendering logic of the vConsole plug-in, and generates an entry into the debugging interface of the web page in the lower right corner of the web page interface. Furthermore, a user can enter a debugging interface of the webpage through the entrance and input a debugging instruction on the webpage debugging interface for debugging. Correspondingly, the execution main body receives a debugging instruction of a user to debug the webpage.
With continued reference to fig. 5, fig. 5 is a schematic diagram 500 of an application scenario of the web page debugging method according to the present embodiment. In the application scenario of fig. 5, a user 501 browses a web page in a browser through a terminal device 502. The server 503 listens to the operation information of the user 501 at the terminal device 502. In response to determining that a click operation (preset operation) of the user 501 for the web page 505 entry in the web page 504 is received, the web page 505 is loaded. The server 501 executes the html document of the web page to load the web page. In the loading process of the webpage, the first script file is executed firstly, and an identifier for representing whether the webpage is debugged or not is obtained in a local storage of the browser. Then, in response to determining that the identifier is the preset debugging identifier, the server 503 executes a second script file, where the second script file is an unencrypted and uncompressed original file representing the service code of the web page, and the second script file includes a preset debugging library, and is only disclosed to the internal network. Finally, in the process of executing the second script file, a debugging entry 506 obtained based on a preset debugging library is displayed in the display interface of the terminal device 502, and a debugging instruction debugging webpage of the user 501 is received.
In the method provided by the above embodiment of the present disclosure, a web page is loaded by responding to a determination that a preset operation of a user is received; in the loading process of the webpage, executing a first script file and acquiring an identifier representing whether the webpage is debugged; responding to the determined identifier as a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the intranet; in the process of executing the second script file, a debugging entry obtained based on a preset debugging library is received, and a debugging instruction of a user is received to debug the webpage, so that the uncompressed and unencrypted second script file is loaded on the webpage in a debugging mode, the readability of webpage codes is improved, and the webpage debugging efficiency can be improved; in the webpage code releasing and deploying stage, the debugging library of the debugging code is already deployed in the second script file, and when an online problem is encountered, the second script file does not need to be modified again to release the webpage again; the second script file is only disclosed for the intranet, and the safety of the webpage is improved.
In some optional implementation manners of this embodiment, before the step 201, the executing entity may further perform the following web page publishing operation:
firstly, a hypertext markup language file, a script language file, a webpage picture file and a webpage style file which are required by a published webpage are generated based on webpage codes representing the webpage, wherein the script language file comprises a first script file, a second script file and a third script file.
Second, for each file in the plurality of files, the file is deployed in a corresponding service based on the file type of the file.
The authority of the user to which each of the plurality of files is directed is different, and therefore, corresponding deployment needs to be performed for different files. Specifically, the hypertext markup language file is deployed in a webpage publishing system, the first script file, the third script file and the webpage style file are deployed in a first service capable of performing domain name resolution on both an internal network and an external network, the second script file is deployed in a second service capable of performing domain name resolution on the internal network, and the webpage picture file is deployed in a third service capable of performing domain name resolution on both the internal network and the external network.
Whether the first service, the second service, or the third service, it is necessary to have a storage function and a parsing function for a file that it is deployed.
Third, the web page is published so that it can be accessed via a URL (Uniform Resource Locator) address.
With continuing reference to FIG. 6, an exemplary flow 600 of another embodiment of a web page debugging method in accordance with the present application is shown comprising the steps of:
step 601, generating a hypertext markup language file, a script language file, a webpage picture file and a webpage style file required by the issued webpage based on the webpage code representing the webpage.
The script language file comprises a first script file, a second script file and a third script file.
Step 602, for each file in the plurality of files, deploying the file in a corresponding service based on the file type of the file.
Step 603, the web page is published.
And step 604, in response to determining that the preset operation of the user is received, loading the webpage.
Step 605, in the process of loading the web page, executing the first script file to obtain an identifier representing whether the web page is debugged.
The first script file comprises preset matching information.
Step 606, in response to the fact that the identification is the preset debugging identification, information to be matched input by the user at the preset terminal of the loaded webpage is obtained.
Step 607, in response to determining that the information to be matched matches the preset matching information, determining that the user is a user with the right to debug the webpage, and executing the second script file.
The second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the internal network.
Step 608, in the process of executing the second script file, a debugging entry obtained based on a preset debugging library is displayed, and a debugging instruction debugging webpage of a user is received.
And step 609, in response to the fact that the identification is not the preset debugging identification, executing a third script file.
Wherein the third script file is an encrypted and/or compressed original file representing the service code of the web page. The non-preset debugging identification can be any identification except the preset debugging identification.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the flow 600 of the web page debugging method in this embodiment specifically illustrates a process from web page publishing to web page debugging, where the process relates to verification of the authority of the user. Therefore, the safety of the webpage verification of the embodiment is further improved.
In order to improve the convenience of webpage debugging, the identifier for indicating whether the webpage is debugged needs to be flexibly changed.
With continuing reference to FIG. 7, an exemplary logic flow 700 for controlling modification of an identifier characterizing whether a web page is debugged is shown comprising the steps of:
step 701, acquiring information to be matched input by a user at a preset terminal for loading a webpage.
Step 702, determining whether the information to be matched is matched with preset matching information.
Step 703, in response to determining that the information to be matched matches the preset matching information, obtaining an identifier representing whether the webpage is debugged.
Step 704, in response to determining that the identifier is the preset debugging identifier, modifying the identifier to be a non-preset debugging identifier.
Step 705, in response to determining that the debugging identifier is not the preset debugging identifier, modifying the identifier into the preset debugging identifier.
And step 706, in response to determining that the information to be matched is not matched with the preset matching information, determining the number of times of error input of the unmatched information to be matched by the user input.
And step 707, in response to the number of times of error input exceeding the preset threshold, stopping acquiring the information input by the user.
Step 708, in response to the number of times of error input exceeding the preset threshold, continuing to execute step 701.
It can be seen from this embodiment that, the user can flexibly modify the identifier during the non-debugging process of the web page, and then can flexibly debug the web page according to the identifier, thereby improving the convenience of debugging the web page.
With continued reference to fig. 8, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of a web page debugging apparatus, where the embodiment of the apparatus corresponds to the embodiment of the method shown in fig. 2, and the apparatus may be specifically applied to various electronic devices.
As shown in fig. 8, the web page debugging apparatus includes: the method comprises the following steps: a loading unit 801 configured to load a web page in response to determining that a preset operation by a user is received; an obtaining unit 802, configured to execute a first script file in a loading process of a web page, and obtain an identifier representing whether the web page is debugged; a first execution unit 803, configured to execute a second script file in response to determining that the identifier is a preset debugging identifier, where the second script file is an unencrypted and uncompressed original file representing a service code of the web page, and includes a preset debugging library, and the second script file is only disclosed to the internal network; and the debugging unit 804 is configured to receive a debugging instruction debugging webpage of a user based on a debugging entry obtained by a preset debugging library in the process of executing the second script file.
In some embodiments, the above apparatus further comprises: and the second execution unit (not shown in the figure) is configured to execute a third script file in response to the determination that the identifier is the non-preset debugging identifier, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
In some embodiments, the first script file includes preset matching information; a first execution unit 803, further configured to: in response to the fact that the identification is the preset debugging identification, acquiring information to be matched, which is input by a user at a preset terminal of the loaded webpage; and responding to the fact that the information to be matched is matched with the preset matching information, determining that the user is the user with the right of debugging the webpage, and executing the second script file.
In some embodiments, a display screen of the preset terminal is provided with a preset dot matrix; a first execution unit 803, further configured to: and acquiring information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
In some embodiments, the first execution unit 803 is further configured to: aiming at each input operation in multiple input operations of a user on a display screen, acquiring the serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation; and determining a plurality of numbers input by the user as the information to be matched input by the user.
In some embodiments, the above apparatus further comprises: a changing unit (not shown in the figure) configured to: and in response to the fact that the information to be matched is matched with the preset matching information, modifying the preset debugging identification into a non-preset debugging identification.
In some embodiments, the above apparatus further comprises: a generating unit (not shown in the figure) configured to generate a hypertext markup language file, a scripting language file, a web page picture file and a web page style file required for publishing a web page based on web page codes representing the web page, wherein the scripting language file comprises a first scripting file, a second scripting file and a third scripting file; a deployment unit (not shown in the figure) configured to deploy, for each file of the plurality of files, the file in the corresponding service based on a file type of the file; a publishing unit (not shown in the figure) configured to publish the web page.
In some embodiments, the deployment unit (not shown in the figures) is further configured to: the method comprises the steps of deploying hypertext markup language files in a webpage publishing system, deploying first script files, third script files and webpage style files in a first service capable of performing domain name resolution on an internal network and an external network, deploying second script files in a second service capable of performing domain name resolution on the internal network, and deploying webpage picture files in a third service capable of performing domain name resolution on the internal network and the external network.
In this embodiment, a loading unit in the web page debugging apparatus loads a web page in response to determining that a preset operation of a user is received; the method comprises the steps that an acquisition unit executes a first script file in the loading process of a webpage to acquire an identifier representing whether the webpage is debugged; the first execution unit responds to the fact that the identification is the preset debugging identification, and executes a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage and comprises a preset debugging library, and the second script file is only disclosed to the internal network; in the process of executing the second script file, the debugging unit receives a debugging instruction of a user to debug the webpage based on a debugging inlet obtained by a preset debugging library, so that the uncompressed and unencrypted second script file is loaded on the webpage in a debugging mode, the readability of a webpage code is improved, and the debugging efficiency of the webpage can be improved; in the webpage code releasing and deploying stage, the debugging library of the debugging code is already deployed in the second script file, and when an online problem is encountered, the second script file does not need to be modified again to release the webpage again; the second script file is only disclosed for the intranet, and the safety of the webpage is improved.
Referring now to FIG. 9, shown is a block diagram of a computer system 900 suitable for use in implementing the devices of embodiments of the present application (e.g., devices 101, 102, 103, 105 shown in FIG. 1). The apparatus shown in fig. 9 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in fig. 9, the computer system 900 includes a processor (e.g., CPU, central processing unit) 901, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data necessary for the operation of the system 900 are also stored. The processor 901, the ROM902, and the RAM903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to bus 904.
The following components are connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary, so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. Which when executed by the processor 901 performs the above-mentioned functions defined in the method of the present application.
It should be noted that the computer readable medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the client computer, partly on the client computer, as a stand-alone software package, partly on the client computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the client computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a loading unit, an obtaining unit, a first execution unit, and a debugging unit. Where the names of the units do not in some cases constitute a limitation on the units themselves, for example, the first execution unit may also be described as a "unit that executes the second script file in response to determining that the identification is the preset debug identification".
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the computer device to: loading a webpage in response to the fact that the preset operation of the user is received; in the loading process of the webpage, executing a first script file and acquiring an identifier representing whether the webpage is debugged; responding to the determined identifier as a preset debugging identifier, executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to the intranet; and receiving a debugging instruction debugging webpage of a user based on a debugging entry obtained by a preset debugging library in the process of displaying and executing the second script file.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (18)

1. A webpage debugging method comprises the following steps:
loading a webpage in response to the fact that the preset operation of the user is received;
executing a first script file in the loading process of the webpage, and acquiring an identifier representing whether the webpage is debugged;
responding to the fact that the identification is a preset debugging identification, and executing a second script file, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an internal network;
and receiving a debugging instruction of the user to debug the webpage based on a debugging entry obtained by the preset debugging library in the process of displaying and executing the second script file.
2. The method of claim 1, further comprising:
and executing a third script file in response to determining that the identifier is a non-preset debugging identifier, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
3. The method of claim 1, wherein the first script file includes preset matching information;
and in response to determining that the identifier is a preset debugging identifier, executing a second script file, including:
in response to the fact that the identification is determined to be a preset debugging identification, acquiring information to be matched, which is input by the user at a preset terminal for loading the webpage;
and responding to the fact that the information to be matched is matched with the preset matching information, determining that the user is a user with the right of debugging the webpage, and executing the second script file.
4. The method according to claim 3, wherein a display screen of the preset terminal is provided with a preset dot matrix;
the acquiring of the information to be matched input by the user at the preset terminal for loading the webpage comprises:
and acquiring the information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
5. The method of claim 4, wherein the obtaining the information to be matched based on the contact information of the user and a preset point in a preset lattice on the display screen comprises:
aiming at each input operation in multiple input operations of the user on the display screen, acquiring the serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation;
and determining a plurality of numbers input by the user as the information to be matched input by the user.
6. The method of claim 1, further comprising:
and in response to the fact that the information to be matched is matched with the preset matching information, the preset debugging identification is modified into a non-preset debugging identification.
7. The method of any of claims 1-6, wherein prior to said loading the web page in response to determining that the user's preset action is received, further comprising:
generating a hypertext markup language file, a scripting language file, a webpage picture file and a webpage style file which are required by publishing the webpage based on a webpage code representing the webpage, wherein the scripting language file comprises the first scripting file, the second scripting file and the third scripting file;
for each file in the plurality of files, deploying the file in a corresponding service based on the file type of the file;
and releasing the webpage.
8. The method of claim 7, wherein the deploying, for each file of the plurality of files, the file in the corresponding service based on the file type of the file comprises:
the method comprises the steps of deploying the hypertext markup language file in a webpage publishing system, deploying the first script file, the third script file and the webpage style file in a first service capable of performing domain name resolution on both an internal network and an external network, deploying the second script file in a second service capable of performing domain name resolution on the internal network, and deploying the webpage picture file in a third service capable of performing domain name resolution on both the internal network and the external network.
9. A web page debugging apparatus comprising:
a loading unit configured to load a web page in response to determining that a preset operation by a user is received;
the acquisition unit is configured to execute a first script file and acquire an identifier representing whether the webpage is debugged in the loading process of the webpage;
a first execution unit configured to execute a second script file in response to determining that the identifier is a preset debugging identifier, wherein the second script file is an unencrypted and uncompressed original file representing the service code of the webpage, the second script file comprises a preset debugging library, and the second script file is only disclosed to an internal network;
and the debugging unit is configured to receive a debugging instruction of the user to debug the webpage based on a debugging inlet obtained by the preset debugging library in the process of executing the second script file.
10. The apparatus of claim 9, further comprising:
a second execution unit configured to execute a third script file in response to determining that the identifier is a non-preset debugging identifier, wherein the third script file is an encrypted and/or compressed original file representing the service code of the webpage.
11. The apparatus of claim 9, wherein the first script file includes preset matching information therein;
the first execution unit, further configured to:
in response to the fact that the identification is determined to be a preset debugging identification, acquiring information to be matched, which is input by the user at a preset terminal for loading the webpage; and responding to the fact that the information to be matched is matched with the preset matching information, determining that the user is a user with the right of debugging the webpage, and executing the second script file.
12. The device of claim 11, wherein a display screen of the preset terminal is provided with a preset dot matrix;
the first execution unit, further configured to:
and acquiring the information to be matched based on the contact information of the user and preset points in a preset dot matrix on the display screen.
13. The apparatus of claim 12, wherein the first execution unit is further configured to:
aiming at each input operation in multiple input operations of the user on the display screen, acquiring the serial number of each preset point contacted by the user in the input operation; determining the number input by the input operation according to the serial numbers of all the preset points contacted in the input operation; and determining a plurality of numbers input by the user as the information to be matched input by the user.
14. The apparatus of claim 9, further comprising:
a change unit configured to:
and in response to the fact that the information to be matched is matched with the preset matching information, the preset debugging identification is modified into a non-preset debugging identification.
15. The apparatus of any of claims 9-14, further comprising:
a generating unit configured to generate a hypertext markup language file, a scripting language file, a web page picture file, and a web page style file required for publishing the web page based on web page codes characterizing the web page, wherein the scripting language file includes the first scripting file, the second scripting file, and the third scripting file;
a deployment unit configured to deploy, for each of a plurality of files, the file in a corresponding service based on a file type of the file;
a publishing unit configured to publish the web page.
16. The apparatus of claim 15, wherein the deployment unit is further configured to:
the method comprises the steps of deploying the hypertext markup language file in a webpage publishing system, deploying the first script file, the third script file and the webpage style file in a first service capable of performing domain name resolution on both an internal network and an external network, deploying the second script file in a second service capable of performing domain name resolution on the internal network, and deploying the webpage picture file in a third service capable of performing domain name resolution on both the internal network and the external network.
17. A computer-readable medium, on which a computer program is stored, wherein the program, when executed by a processor, implements the method of any one of claims 1-8.
18. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
CN202010991501.6A 2020-09-17 2020-09-17 Webpage debugging method and device Active CN113760706B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010991501.6A CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010991501.6A CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Publications (2)

Publication Number Publication Date
CN113760706A true CN113760706A (en) 2021-12-07
CN113760706B CN113760706B (en) 2024-05-17

Family

ID=78785737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010991501.6A Active CN113760706B (en) 2020-09-17 2020-09-17 Webpage debugging method and device

Country Status (1)

Country Link
CN (1) CN113760706B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106713321A (en) * 2016-12-26 2017-05-24 中国银联股份有限公司 Authority management method and device for debugging function of point of sale
CN107729232A (en) * 2017-09-27 2018-02-23 深圳市赛亿科技开发有限公司 A kind of script debugging method and device based on JS
US9959192B1 (en) * 2015-09-15 2018-05-01 Google Llc Debugging interface for inserted elements in a resource
CN108063959A (en) * 2016-11-09 2018-05-22 北京国双科技有限公司 Adjustment method, client, server and the system of set-top box
US20180150349A1 (en) * 2016-11-30 2018-05-31 Oracle International Corporation Secure debugging with an encrypted token
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN109408310A (en) * 2018-10-19 2019-03-01 网易(杭州)网络有限公司 Adjustment method, server and the readable storage medium storing program for executing of server
CN110795344A (en) * 2019-10-14 2020-02-14 深圳晶泰科技有限公司 Distributed high-performance computing cluster-oriented debugging system
CN111078554A (en) * 2019-12-16 2020-04-28 腾讯科技(深圳)有限公司 Applet debugging method, device, equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9959192B1 (en) * 2015-09-15 2018-05-01 Google Llc Debugging interface for inserted elements in a resource
CN108063959A (en) * 2016-11-09 2018-05-22 北京国双科技有限公司 Adjustment method, client, server and the system of set-top box
US20180150349A1 (en) * 2016-11-30 2018-05-31 Oracle International Corporation Secure debugging with an encrypted token
WO2018108041A1 (en) * 2016-12-13 2018-06-21 腾讯科技(深圳)有限公司 Remote debugging method and device, and computer storage medium
CN106713321A (en) * 2016-12-26 2017-05-24 中国银联股份有限公司 Authority management method and device for debugging function of point of sale
CN107729232A (en) * 2017-09-27 2018-02-23 深圳市赛亿科技开发有限公司 A kind of script debugging method and device based on JS
CN109408310A (en) * 2018-10-19 2019-03-01 网易(杭州)网络有限公司 Adjustment method, server and the readable storage medium storing program for executing of server
CN110795344A (en) * 2019-10-14 2020-02-14 深圳晶泰科技有限公司 Distributed high-performance computing cluster-oriented debugging system
CN111078554A (en) * 2019-12-16 2020-04-28 腾讯科技(深圳)有限公司 Applet debugging method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
温铂;马占卿;: "Web网络应用程序开发的安全策略研究", 内蒙古医学院学报, no. 1, 15 December 2007 (2007-12-15) *

Also Published As

Publication number Publication date
CN113760706B (en) 2024-05-17

Similar Documents

Publication Publication Date Title
US8621613B1 (en) Detecting malware in content items
CN109684188B (en) Test method and device
GB2589658A (en) Method and apparatus for running an applet
CN109359194B (en) Method and apparatus for predicting information categories
CN107305528B (en) Application testing method and device
CN109582317B (en) Method and apparatus for debugging hosted applications
CN112463729B (en) Data file warehousing method and device, electronic equipment and medium
CN110928571A (en) Business program development method and device
CN113760729A (en) Code detection method and device
CN112631590A (en) Component library generation method and device, electronic equipment and computer readable medium
CN107229565B (en) Test method and device
US20160261623A1 (en) Detecting Malware In Content Items
CN112559024A (en) Method and device for generating transaction code change list
CN115408245A (en) Data flow tracking method and system, electronic equipment and storage medium
CN110780874B (en) Method and device for generating information
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
CN111338928A (en) Chrome-based browser testing method and device
CN113760706B (en) Webpage debugging method and device
CN114691527A (en) Unit test case generation method, apparatus, device, medium, and program product
CN111737129B (en) Service control method, device, computer readable medium and electronic equipment
CN113535565A (en) Interface use case generation method, device, equipment, medium and program product
CN110196803B (en) Software defect training method and system
CN113312900A (en) Data verification method and device
CN108170557B (en) Method and apparatus for outputting information

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