CN105373548B - Mobile device and method for customizing event by browser thereof - Google Patents

Mobile device and method for customizing event by browser thereof Download PDF

Info

Publication number
CN105373548B
CN105373548B CN201410421989.3A CN201410421989A CN105373548B CN 105373548 B CN105373548 B CN 105373548B CN 201410421989 A CN201410421989 A CN 201410421989A CN 105373548 B CN105373548 B CN 105373548B
Authority
CN
China
Prior art keywords
event
browser
function
mobile device
processing function
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
Application number
CN201410421989.3A
Other languages
Chinese (zh)
Other versions
CN105373548A (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.)
Shenzhen Yayue Technology Co ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410421989.3A priority Critical patent/CN105373548B/en
Publication of CN105373548A publication Critical patent/CN105373548A/en
Application granted granted Critical
Publication of CN105373548B publication Critical patent/CN105373548B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method for customizing an event by a browser, which is applied between mobile equipment and a webpage server. The method comprises the following steps: the mobile equipment provides an interface format to the webpage server through a browser; the mobile equipment receives a behavior function of a custom event which is in accordance with the interface format and comes from a webpage server, wherein the behavior function of the custom event at least comprises an event type and a processing function; and the mobile equipment calls a corresponding processing function according to the event type, and realizes the setting of the processor on the operating system through the processing function. The invention also discloses a mobile device. The method for customizing the event by the browser and the mobile device provided by the invention can flexibly realize the customized events of various browsers by providing an interface format for the webpage server and receiving and calling the behavior functions corresponding to different event types.

Description

Mobile device and method for customizing event by browser thereof
Technical Field
The invention belongs to the technical field of browsers, and particularly relates to a mobile device and a method for customizing an event by a browser of the mobile device.
Background
The World Wide Web Consortium (W3C) organizes basic events that define scripts (javascript) at the front end of many Web pages (Web), such as mouse down events, double click events, out-of-focus events, etc., the occurrence of these events greatly enriches the capabilities of javascript. With the advent of the mobile internet era, the front end of web pages is becoming more and more important on mobile devices.
Since the screen sizes of mobile devices and Personal Computers (PCs) are very different, this directly results in web page designs that cannot be directly moved from the PC to the mobile device. In addition, the mobile device has many special events, such as horizontal and vertical screen switching, wireless network switching, etc., and the processing definition of the special events is beyond the standard defined by W3C.
Therefore, a set of custom event framework based on the browser of the mobile device needs to be designed, so that the mobile device can realize various types of special events out of the W3C standard.
Disclosure of Invention
The invention aims to provide a mobile device and a method for customizing an event by a browser of the mobile device, and aims to solve the problem that the script of the traditional webpage is not completely suitable for the mobile device to display in the prior art.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
a method for customizing an event by a browser is applied between a mobile device and a webpage server, and comprises the following steps:
the mobile equipment provides an interface format to the webpage server through a browser;
the mobile equipment receives a behavior function of a custom event which is in accordance with the interface format and comes from a webpage server, wherein the behavior function of the custom event at least comprises an event type and a processing function; and
and the mobile equipment calls a corresponding processing function according to the event type, and realizes the setting of the browser on an operating system through the processing function.
In order to solve the above technical problems, embodiments of the present invention provide the following technical solutions:
a mobile device for communicating with a web server and supporting browser customization events, the mobile device comprising:
the browser module is used for providing an interface format of a user-defined event through a browser;
the communication module is used for sending the interface format to a webpage server and receiving a behavior function of a custom event which accords with the interface format from the webpage server, wherein the behavior function at least comprises an event type and a processing function;
the system setting module is used for calling a corresponding processing function through the event type and realizing the setting of the browser on an operating system through the processing function;
a processor for executing the functions of the browser module, the communication module, and the system setting module; and
a memory for storing data generated by the mobile device during operation.
According to the method and the device, the interface format is provided for the webpage server, the behavior function of the user-defined event conforming to the interface format is received, the corresponding processing function is called according to the event type, the setting of the operating system of the mobile equipment is realized, the flexibility is improved, and the experience of a user on the browser is improved.
Drawings
FIG. 1 is a schematic diagram of an application environment of a mobile device and a method for customizing an event by a browser thereof according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for customizing an event in a browser of a mobile device according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a detailed method for registering and deregistering browser custom events according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating a detailed process of a method for binding browser custom events according to an embodiment of the present invention;
FIG. 5 is a flowchart illustrating a detailed process of a method for unbinding a browser custom event according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a detailed process of a method for processing a self-browser defined event according to an embodiment of the present invention;
fig. 7 is a block diagram of a mobile device according to an embodiment of the present invention.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements throughout, the principles of the present invention are illustrated in a suitable computing environment. The following description is based on illustrated embodiments of the invention and should not be taken as limiting the invention with regard to other embodiments that are not detailed herein.
In the description that follows, specific embodiments of the present invention are described with reference to steps and symbols executed by one or more computers, unless otherwise indicated. Accordingly, these steps and operations will be referred to, several times, as being performed by a computer, the computer performing operations involving a processing unit of the computer in electronic signals representing data in a structured form. This operation transforms the data or maintains it at locations in the computer's memory system, which may be reconfigured or otherwise altered in a manner well known to those skilled in the art. The data maintains a data structure that is a physical location of the memory that has particular characteristics defined by the data format. However, while the principles of the invention have been described in language specific to above, it is not intended to be limited to the specific form set forth herein, but on the contrary, it is to be understood that various steps and operations described hereinafter may be implemented in hardware.
The principles of the present invention are operational with numerous other general purpose or special purpose computing, communication environments or configurations. Examples of well known computing systems, environments, and configurations that may be suitable for use with the invention include, but are not limited to, hand-held telephones, personal computers, servers, multiprocessor systems, microcomputer-based systems, mainframe-based computers, and distributed computing environments that include any of the above systems or devices.
The term "module" as used herein may be considered a software object executing on the computing system. The different components, modules, engines, and services described herein may be considered as implementation objects on the computing system. The apparatus and method described herein are preferably implemented in software, but may also be implemented in hardware, and are within the scope of the present invention.
Referring to fig. 1, a schematic diagram of an application environment of a mobile device and a method for customizing an event by a browser thereof according to an embodiment of the present invention includes a mobile device 10 and a personal computer 20 at a client, at least one web server 40, and a communication network 30.
The web server 40 is used for providing web contents and forms suitable for the type of display for various types of clients (such as the mobile device 10 or the personal computer 20).
In the present invention, the web server 40 includes a global function in the provided page. The global function is used for calling the browser of the client and generating a corresponding custom interface of each client.
The communication Network 30, which is generally referred to as a Wireless Network, includes a Wireless Wide Area Network (WWAN), a Wireless Local Area Network (WLAN), a Wireless Metropolitan Area Network (WMAN), and a Wireless Personal Area Network (WPAN). In the present invention, the wireless wide area network is the most common, and mainly includes a 3G system, a 4G system, and the like. Of course, the inclusion of other wires is not excluded.
The mobile device 10 includes not only a common smart phone, a Personal Digital Assistant (PDA), a netbook (Web pad), and the like, but also other terminals equipped with a storage unit and a microprocessor and having an arithmetic capability.
In the present invention, the browser of the mobile device 10 provides an interface (API) format for the web server 40 to process the browser custom event; meanwhile, the web page of the web server 40 provides a global function, and when the user-defined event occurs, the browser calls the global function to set the operating system, so that the processing and the display of the browser are realized.
Through the interface provided by the browser and the call of the global function provided by the webpage, the browser-defined event in the mobile device 10 is realized, more personalized operations are provided for the webpage browsing of the mobile device, and the experience of the user when browsing the webpage is improved.
Please refer to the following examples, wherein example 1 mainly illustrates the core steps of the present invention. The implementation of the custom event of the invention can be further refined into three steps, including the event registration and the event deregistration of the custom event, refer to embodiment 2; the event binding and event unbinding of the custom event are referred to in embodiment 3 and embodiment 4; triggering of custom events, see example 5; and a mobile device having a browser-defined event function, see embodiment 6.
Example 1
Referring to fig. 2, a flowchart of a method for browser-defined events of a mobile device according to the present invention is shown, wherein the method is applied between the mobile device 10 and the web server 40 shown in fig. 1.
In step S201, the mobile device provides an interface format to the web server.
In an embodiment, the mobile device provides a basic javascript component through a browser, and encapsulates the above-mentioned event registration/event de-registration, event binding/event de-binding event, and the process of invoking the corresponding event handling function after event triggering, that is, provides an encapsulated and compact interface to the web server, and the format of the encapsulated and compact interface is as follows:
qb_bridge.addEventListener(type,handler);
wherein type is an event type and handler is an event handling function.
In another embodiment, an interface may also be provided for a single event type, formatted as follows:
qb_bridge.exec(null,null,service,action,{numHandlers:num});
wherein, service is a specific event name, action is a behavior (registration/deregistration), and numHandlers identifies the binding times. The script javascript of the web server notifies the browser to register or deregister a specified custom event by calling the interface, and then the processor notifies the system of the mobile device to register or deregister the custom event.
In step S202, a behavior function of the custom event conforming to the interface format is received from the web server.
In this step, the behavior function at least includes an event type and a processing function, and typically also includes an event name and an event parameter.
The event types include: one or more of event registration, event de-registration, event binding, event unbinding, and event triggering.
In step S203, the mobile device calls a corresponding processing function through the event type, and the browser implements setting of an operating system through the processing function.
It is to be understood that if the type is registration, the setting of registration is implemented to the operating system by calling the processing function of registration. If the type is the de-registration, the de-registration setting is realized for the operating system by calling the processing function of the de-registration. Please refer to the following embodiments.
Example 2
Fig. 3 is a detailed flowchart of a method for registering and deregistering a custom event according to an embodiment of the present invention.
In step S301, the browser provides an interface format for the web server to perform registration and deregistration of the custom event.
In one embodiment, the interface format is as follows:
qb_bridge.exec(null,null,service,action,{numHandlers:num});
wherein, service is a specific event name, action is a behavior (registration/deregistration), and numHandlers identifies the binding times. javascript by invoking this interface, the web server notifies the browser to register or deregister a specified event, and the browser then notifies the mobile device system to register or deregister the event.
In another embodiment, the interface format is:
qb_bridge.addEventListener(type,handler);
wherein type is an event type and handler is an event handling function.
In step S302, the communication module receives the custom event type of the event registration sent by the web server.
It can be understood that: the web server provides the self-defined event meeting the format requirement according to the interface format of the browser.
In step S303, the processor writes the event name of the custom event into the registry.
It can be understood that: before step S303 is executed, a step of determining whether the event name is already registered in the registry may be added, if the event name is not registered, step S302 is executed, and if the event name is already registered, the registered behavior function is ignored or ended.
In this way, the event registration of the custom event is completed.
In step S304, the communication module receives a behavior function of event de-registration sent by the web server.
In step S305, the event name of the custom event is deleted from the registry.
It can be understood that: before step S305 is executed, a step of determining whether the event registration information (i.e., the event name) exists in the registry may be added, and if the event registration information exists, the step S305 is executed, and if the event registration information does not exist, the action function of the event de-registration is ignored.
Example 3
Fig. 4 is a schematic flowchart illustrating a detailed process of an event binding method for a custom event according to an embodiment of the present invention.
In step S401, the mobile device receives an event binding behavior function of a browser custom event sent by the web server.
It is understood that the browser custom event includes a custom event name, an event type, an event parameter, a processing function corresponding to the event option, and the like.
In step S402, the mobile device determines whether the custom event is registered.
It can be understood that: the determination of event registration is performed by the processor and is queried and determined in a registry of the mobile device. If not, executing step S403; if so, go to step S404.
In step S403, the custom event is registered in a registry.
In step S404, it is determined whether there is an event parameter corresponding to the custom event in the mapping module.
It is understood that the determination of the corresponding event parameter is performed by the processor and is queried and determined in the mapping module.
The mapping module, also called a map container, is used for storing information of the bound custom event, including a registered event type (key) and a corresponding event parameter (value). Since the same event is allowed to bind multiple different handling functions, a queue of event handling functions is maintained in all values.
If the determined result is no corresponding option, executing step S405; if there is a corresponding option, go to step S406.
In step S405, the corresponding event parameter is inserted in the mapping module.
In step S406, it is determined whether a processing function corresponding to the event parameter is registered.
It is to be understood that the determination of the corresponding processing function is performed by the processor and is queried and determined in the mapping module.
If the corresponding processing function is registered, step S407 is executed, no change is required, and the event bound behavior function is ignored.
If the corresponding processing function is not registered, step S408 is executed to add the corresponding processing function to the queue of the mapping module.
It can be understood that: the binding event handling function inserts a record into the queue and removes the corresponding record from the queue when unbinding. How are function objects in the queue identified? Each time the processing function of the event is bound, a unique ID is generated as the attribute of the processing function, and the ID can uniquely determine a function object. In the above way, the binding of the to-be-bound custom event is completed.
Example 4
Fig. 5 is a detailed flowchart of a method for unbinding a custom event according to an embodiment of the present invention.
In step S501, the communication module receives an event unbinding behavior function sent by the web server.
In step S502, it is determined whether the event name of the event unbind is registered in the registry.
If the event name is not registered, in step S503, the event unbinding behavior function is ignored or ended.
If the event name is registered, in step S504, it is determined whether the event parameter corresponding to the event is registered for the event unbinding.
If there is no corresponding event parameter, the event unbinding step is ended in step S503.
If there is a corresponding event parameter, in step S505, it is determined whether the corresponding processing function is registered in the event parameter.
If the corresponding processing function is not registered, in step S503, the event unbinding step is ignored or ended.
If the corresponding function is registered, in step S506, the corresponding processing function is deleted from the queue of the mapping module.
In the above way, the behavior of unbinding the event of the user-defined event is completed.
It can be understood that, in step S503, if the event itself of the unbound custom event is not registered, the event parameter of the custom event is not included, or the processing function corresponding to the event parameter is not included, the event unbound step may be directly omitted or ended without event unbound.
Example 5
Fig. 6 is a flowchart illustrating a detailed process of a method for triggering a custom event according to an embodiment of the present invention.
In step S601, the communication module receives a behavior function sent by the web server, where the behavior function includes an event name, an event object, an event type, an event parameter, and a processing function of a custom event.
In one embodiment, the format of the behavior function is as follows:
qb_bridge.fireEvent(type,option);
wherein type is event type and option is event parameter.
In step S602, the processor calls the behavior function, i.e., type, option, and generates an empty normal Event.
In step S603, the Event parameter option is copied to the standard Event.
In step S604, a corresponding processing function queue is searched from the mapping module according to the event type.
In step S605, the processing function is executed, and the execution result is passed to the callback function.
It can be understood that: if the event parameter option is directly transmitted to the callback function, a problem occurs at this time because after all, the event is not a standard event, the property of the standard event object is not in the event, and an error is reported when the property which does not exist is operated in the callback function. Before the Event parameter option is transmitted to the callback function, an empty standard Event object Event is created by calling a custom processing function document of the browser, and then the Event in the option is copied and finally transmitted to the callback function.
Example 6
Fig. 7 is a block diagram of a mobile device according to an embodiment of the present invention. The mobile device 10 includes a processor 11, a browser module 12, a memory 13, a communication module 14, and a system setup module 15. It is understood that the mobile device 10 further includes a display, a touch key, and a voice input/output device, which are not directly related to the design of the present invention, and therefore, the detailed description thereof is omitted.
The processor 11 is configured to execute basic functions of the browser module 12, the memory 13, the communication module 14, and the system setting module 15. In addition, the processor 11 is further configured to read various types of information from the memory for judgment according to the processing procedure of the custom event, and determine the execution steps of the basic functions according to the judgment result.
And the browser module 12 is used for providing an interface format of the custom event, so that the web server 40 can set the custom event.
The information of the self-defined event of the browser comprises an event name, an event type, an event parameter and an event processing function. The correspondence therebetween is: one event type can correspond to a plurality of event names; one event type can correspond to a plurality of event parameters; one event parameter may correspond to a plurality of processing functions.
In one embodiment, the interface format is as follows:
qb_bridge.exec(null,null,service,action,{numHandlers:num});
wherein, service is a specific event name, action is a behavior (registration/deregistration), and numHandlers identifies the binding times. javascript by invoking this interface, the web server notifies the browser to register or deregister a specified event, and the browser then notifies the mobile device system to register or deregister the event.
In another embodiment, the browser module 12 may provide a compact API to the web server by providing a basic javascript component to encapsulate the registration/deregistration event, bind/unbind the event, and invoke the corresponding event handling function after the event is triggered, and the format is as follows:
qb_bridge.addEventListener(type,handler);
wherein type is an event type and handler is an event handling function.
The communication module 14 is used for wirelessly connecting with the web server 40 through the communication network 30. It can be understood that: the communication module is typically connected via a wireless connection, such as 3G, 4G, etc.
The memory 13 is used for storing data generated by the mobile device during operation. In a configured embodiment, the memory includes a registry and a mapping module.
The registry is used for storing the registration of the browser custom event. It can be understood that: when the mobile equipment receives the registration of the browser custom event, adding a piece of registration information in the registry; and after the mobile equipment receives the deregistration of the browser custom event, the processor judges whether the corresponding registration information exists in the registry or not, and if so, the deletion operation is carried out in the registry.
The mapping module is used for storing the bound event information, wherein key is the registered event type, value is the corresponding event information, and as the same event is allowed to bind a plurality of different event processing functions, a queue of one event processing function is maintained in all values. The binding event handling function inserts a record into the queue and removes the corresponding record from the queue when unbinding. How are function objects in the queue identified? Each time the processing function of the event is bound, a unique id is generated as the attribute of the processing function, and the id can uniquely determine a function object.
The system setting module is used for setting a bottom layer system (namely, an operating system) of the mobile equipment after receiving the event trigger information, such as horizontal and vertical screen switching, wireless network switching, volume adjustment and the like.
It can be understood that: the word "preferred" is used herein to mean serving as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as advantageous over other aspects or designs. Rather, use of the word "preferred" is intended to present concepts in a concrete fashion. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless specified otherwise or clear from context, "X employs A or B" is intended to include either of the permutations as a matter of course. That is, if X employs A; b is used as X; or X employs both A and B, then "X employs A or B" is satisfied in any of the foregoing examples.
Also, although the disclosure has been shown and described with respect to one or more implementations, equivalent alterations and modifications will occur to others skilled in the art based upon a reading and understanding of this specification and the annexed drawings. The present disclosure includes all such modifications and alterations, and is limited only by the scope of the appended claims. In particular regard to the various functions performed by the above described components (e.g., elements, resources, etc.), the terms used to describe such components are intended to correspond, unless otherwise indicated, to any component which performs the specified function of the described component (e.g., that is functionally equivalent), even though not structurally equivalent to the disclosed structure which performs the function in the herein illustrated exemplary implementations of the disclosure. In addition, while a particular feature of the disclosure may have been disclosed with respect to only one of several implementations, such feature may be combined with one or more other features of the other implementations as may be desired and advantageous for a given or particular application. Furthermore, to the extent that the terms "includes," has, "" contains, "or variants thereof are used in either the detailed description or the claims, such terms are intended to be inclusive in a manner similar to the term" comprising.
Various operations of embodiments are provided herein. In one embodiment, the one or more operations may constitute computer readable instructions stored on one or more computer readable media, which when executed by a server, will cause a computing device to perform the operations. The order in which some or all of the operations are described should not be construed as to imply that these operations are necessarily order dependent. Those skilled in the art will appreciate alternative orderings having the benefit of this description.
In the above embodiments, the descriptions of the embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the detailed description throughout the specification, and no further description is given here.
The mobile device and the method for customizing the event by the browser thereof provided by the embodiment of the invention belong to the same conception, and the specific implementation process is detailed in the whole specification and is not repeated herein.
It should be noted that, for the method for customizing an event in a browser according to the present invention, it can be understood by a person skilled in the art that all or part of the process of implementing the application program running method according to the embodiment of the present invention can be completed by controlling related hardware through a computer program, where the computer program can be stored in a computer readable storage medium, such as a memory of a client, and executed by at least one processor in the terminal, and the process of executing the embodiment of the running method can be included in the process of executing the computer program. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
For the mobile device according to the embodiment of the present invention, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
In summary, although the present invention has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present invention, and various changes and modifications can be made by one skilled in the art without departing from the spirit and scope of the present invention.

Claims (17)

1. A method for customizing an event by a browser is applied between a mobile device and a webpage server, and is characterized by comprising the following steps:
the mobile device provides an interface format of a browser to the webpage server through the browser of the mobile device;
the mobile equipment receives a behavior function of a custom event which is in accordance with the interface format and comes from a webpage server, wherein the custom event is a special event out of the W3C standard, and the behavior function of the custom event at least comprises an event type and a processing function; and
and the mobile equipment calls a corresponding processing function according to the event type, and realizes the setting of the browser on an operating system through the processing function.
2. The method of browser customization events according to claim 1, wherein the event types include: one or more of event registration, event de-registration, event binding, event unbinding, and event triggering.
3. The method of browser customization events according to claim 2, wherein the behavioral function further comprises: event name and event parameters.
4. The method for browser custom event according to claim 1, when said event type is event registration, further comprising the steps of:
acquiring an event name in a behavior function;
writing the event name to a registry located on the mobile device.
5. The method for browser self-defining event according to claim 1 or 4, when the event type is event de-registration, further comprising the steps of:
judging whether the registry of the mobile equipment has the event name of the user-defined event or not;
if the event name does not exist in the registry, ignoring a behavior function corresponding to the event de-registration; or
And if the event name exists in the registry, deleting the event name from the registry.
6. The method of browser-customizing events as claimed in claim 5, further comprising the step of, when said event type is an event binding:
judging whether the event name of the user-defined event exists in a registry in the mobile equipment;
if the event name does not exist in the registry, writing the event name into the registry;
if the event name exists in the registry, judging whether an event parameter corresponding to the event name exists in a mapping module;
if the event parameter does not exist, inserting the event parameter into the mapping module;
if the event parameter exists, judging whether the processing function is registered in the mapping module;
if the processing function is registered, ignoring the event-bound behavior function;
and if the processing function is not registered, adding the processing function into the function queue of the self-defined event.
7. The method of browser-customizing an event as claimed in claim 5, further comprising the step of, when said event type is event unbinding:
judging whether the event name of the user-defined event exists in a registry in the mobile equipment;
if the event name exists in the registry, judging whether an event parameter of the user-defined event exists in a mapping module;
if the event parameter exists in the registry, judging whether a processing function of the user-defined event exists in the mapping module;
if the mapping module has the processing function of the self-defined event, deleting the processing function from the queue of the mapping module;
if the result of the determination in any one of the above steps is none, the behavior function corresponding to the event unbinding can be ignored.
8. The method for browser custom event according to claim 1, when said event type is event trigger, further comprising the steps of:
receiving a behavior function sent by the webpage server, wherein the behavior function comprises the event type, the event parameter and a processing function;
calling the behavior function and generating an empty standard event;
writing the event parameters to the standard event;
searching one or more corresponding processing functions from a mapping module according to the event type corresponding to the event parameter; and
and executing the processing function and transmitting an execution result to the callback function.
9. A mobile device for communicating with a web server and supporting browser customization events, the mobile device comprising:
the browser module is used for providing an interface format of a browser of a user-defined event through the browser of the mobile equipment, wherein the user-defined event is a special event out of a W3C standard;
the communication module is used for sending the interface format to a webpage server and receiving a behavior function of a custom event which accords with the interface format from the webpage server, wherein the behavior function at least comprises an event type and a processing function;
the system setting module is used for calling a corresponding processing function through the event type and realizing the setting of the browser on an operating system through the processing function;
a processor for executing the functions of the browser module, the communication module, and the system setting module; and
a memory for storing data generated by the mobile device during operation.
10. The mobile device of claim 9, wherein the event type comprises: one or more of event registration, event de-registration, event binding, event unbinding, and event triggering.
11. The mobile device of claim 10, wherein the custom event comprises: one or more of an event name, an event type, an event parameter, and a handling function.
12. A mobile device as recited in any of claims 9-11, wherein a registry is included in the memory for storing event names associated with event registrations or event registration deactivations.
13. The mobile device according to any one of claims 9 to 11, wherein the memory comprises a mapping module for storing a correspondence between event names, event types, event parameters and processing functions related to event binding or event unbinding.
14. The mobile device of claim 13, wherein each event type in the mapping module corresponds to at least one event parameter, one event parameter corresponding to at least one processing function.
15. The mobile device of claim 14, wherein the processing functions are maintained in a queue in the mapping module, and each processing function generates a unique function ID when bound.
16. A mobile device for communicating with a web server and supporting browser customization events, the mobile device comprising a memory and a processor, the memory having stored therein a computer program that, when executed by the processor, causes the processor to perform the steps of:
providing an interface format of a browser to the web server through the browser of the mobile device;
receiving a behavior function of a custom event which is in accordance with the interface format and is from a webpage server, wherein the custom event is a special event out of the W3C standard, and the behavior function of the custom event at least comprises an event type and a processing function; and
and calling a corresponding processing function according to the event type, and realizing the setting of the browser on an operating system through the processing function.
17. A computer-readable storage medium storing a computer program which, when run on a computer, causes the computer to perform a method of browser customization events as claimed in claim 1.
CN201410421989.3A 2014-08-25 2014-08-25 Mobile device and method for customizing event by browser thereof Active CN105373548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410421989.3A CN105373548B (en) 2014-08-25 2014-08-25 Mobile device and method for customizing event by browser thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410421989.3A CN105373548B (en) 2014-08-25 2014-08-25 Mobile device and method for customizing event by browser thereof

Publications (2)

Publication Number Publication Date
CN105373548A CN105373548A (en) 2016-03-02
CN105373548B true CN105373548B (en) 2020-10-13

Family

ID=55375755

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410421989.3A Active CN105373548B (en) 2014-08-25 2014-08-25 Mobile device and method for customizing event by browser thereof

Country Status (1)

Country Link
CN (1) CN105373548B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808259A (en) * 2016-03-09 2016-07-27 北京京东尚科信息技术有限公司 Method for view element to dynamically configure response event, mobile terminal and server
CN106126233A (en) * 2016-06-24 2016-11-16 武汉斗鱼网络科技有限公司 A kind of event scheduling method and device based on ejector
CN108958905B (en) * 2017-05-25 2024-04-05 北京忆恒创源科技股份有限公司 Lightweight operating system of embedded multi-core central processing unit
CN109246177B (en) * 2018-07-04 2021-04-27 武汉斗鱼网络科技有限公司 Method for designing asynchronous communication tool in Android
CN111781478A (en) * 2019-03-18 2020-10-16 北京北方华创微电子装备有限公司 Component service life monitoring method and system
CN112131500B (en) * 2020-09-25 2023-11-07 北京锐安科技有限公司 Event response device, method, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102882982A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Browser message sending equipment, browser message receiving equipment, communication method and communication system
CN103455405A (en) * 2012-06-04 2013-12-18 阿里巴巴集团控股有限公司 Method and system for preventing button from being clicked repeatedly and method and system for unlocking button

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103455405A (en) * 2012-06-04 2013-12-18 阿里巴巴集团控股有限公司 Method and system for preventing button from being clicked repeatedly and method and system for unlocking button
CN102882982A (en) * 2012-10-19 2013-01-16 北京奇虎科技有限公司 Browser message sending equipment, browser message receiving equipment, communication method and communication system

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
HTML5 服务器推送事件(Server-sent Events)实战开发;成富;《IBM》;20130718;正文第1-5页 *
成富.HTML5 服务器推送事件(Server-sent Events)实战开发.《IBM》.2013, *
浏览器事件机制与自定义事件的实现;kuangxiang_panpan;《CSDN》;20120214;正文第2-10页 *

Also Published As

Publication number Publication date
CN105373548A (en) 2016-03-02

Similar Documents

Publication Publication Date Title
CN105373548B (en) Mobile device and method for customizing event by browser thereof
US8868637B2 (en) Page rendering for dynamic web pages
US8453049B1 (en) Delayed code parsing for reduced startup latency
CN106547580B (en) Method and device for hooking function, mobile terminal and storage medium
US11706331B2 (en) Information processing method and apparatus, storage medium, and electronic device
KR20200043467A (en) Method and terminal device for extracting web page content
US11010215B2 (en) Recommending applications based on call requests between applications
US20130091197A1 (en) Mobile device as a local server
KR102159416B1 (en) Systems and methods for building and using hybrid mobile applications
CN106716351B (en) Method and electronic equipment for displaying webpage
CN110096370B (en) Control inversion component service model for virtual environments
CN109240697B (en) Call processing method and device and storage medium
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
US20130151571A1 (en) Interface defined virtual data fields
CN111124544A (en) Interface display method and device, electronic equipment and storage medium
CN111064610B (en) Log file subscription method, terminal device and storage medium
CN109558187B (en) User interface rendering method and device
CN112835632A (en) Method and device for calling end capability and computer storage medium
CN111736776B (en) Data storage and reading method and device
CN105279164B (en) File processing method and device based on IOS (input/output system)
JP2005228183A (en) Program execution method and computer system for executing the program
CN117390326A (en) Page management method, device, equipment and storage medium
CN111078219B (en) Page display method, device and system, electronic equipment and storage medium
CN104346228B (en) The method and terminal of sharing application program
CN111382039A (en) Method, device, electronic equipment and storage medium for reporting user behavior event

Legal Events

Date Code Title Description
C06 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
TR01 Transfer of patent right

Effective date of registration: 20221114

Address after: 1402, Floor 14, Block A, Haina Baichuan Headquarters Building, No. 6, Baoxing Road, Haibin Community, Xin'an Street, Bao'an District, Shenzhen, Guangdong 518,101

Patentee after: Shenzhen Yayue Technology Co.,Ltd.

Address before: 2, 518000, East 403 room, SEG science and Technology Park, Zhenxing Road, Shenzhen, Guangdong, Futian District

Patentee before: TENCENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right