CN110245315B - Method, device, controller and storage medium for simulating APP title bar in webpage - Google Patents

Method, device, controller and storage medium for simulating APP title bar in webpage Download PDF

Info

Publication number
CN110245315B
CN110245315B CN201910551480.3A CN201910551480A CN110245315B CN 110245315 B CN110245315 B CN 110245315B CN 201910551480 A CN201910551480 A CN 201910551480A CN 110245315 B CN110245315 B CN 110245315B
Authority
CN
China
Prior art keywords
app
webpage
title bar
simulating
web page
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910551480.3A
Other languages
Chinese (zh)
Other versions
CN110245315A (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 Xiangshang Yixin Technology Co ltd
Original Assignee
Beijing Xiangshang Yixin 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 Xiangshang Yixin Technology Co ltd filed Critical Beijing Xiangshang Yixin Technology Co ltd
Priority to CN201910551480.3A priority Critical patent/CN110245315B/en
Publication of CN110245315A publication Critical patent/CN110245315A/en
Application granted granted Critical
Publication of CN110245315B publication Critical patent/CN110245315B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • 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/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention relates to a method for simulating an APP title bar in a webpage, a device for simulating the APP title bar in the webpage, a controller and a computer readable storage medium, wherein the method comprises the steps of adding a request parameter in a command requesting a URL (uniform resource locator) to delete a first title bar in the APP; detecting whether an environment for opening a webpage is an APP or not; and when the environment for opening the webpage is detected to be APP, creating a second title bar in the webpage. By the method for simulating the APP title bar in the webpage, the title bar in the APP is simulated in the webpage, and the purpose of self-defining the function in the title bar is further achieved, so that the title bar can achieve different functions according to different webpage contents.

Description

Method, device, controller and storage medium for simulating APP title bar in webpage
Technical Field
The present invention relates to the field of internet technologies, and in particular, to a method for simulating an APP title bar in a webpage, an apparatus for simulating an APP title bar in a webpage, a controller, and a computer-readable storage medium.
Background
With the development of Wireless Application Protocol (WAP) technology, it is possible for Wireless devices such as mobile terminals to access the internet, for example, WAP websites of mobile phones, and the WAP technology converts information on the internet into information that can be displayed on mobile devices such as mobile phone screens, which greatly facilitates users of mobile terminals to browse information on the internet.
At present, most users usually use mobile phone APPs (Application, mobile phone software) to browse web page contents, in order to meet the demand of users for information, more and more various information content pages can be carried by one web page, in order to help users to obtain corresponding information in time, a title bar mode is usually adopted to facilitate the operation of users, in the existing APPs, web pages are generally loaded and displayed by a web view (web view) in the web page, in this case, a own title bar in the web page view is used, and all functions of the title bar are controlled by the mobile phone APPs. The web page opened therein does not have the ability to control this title bar, so no custom function can be added to the title bar through the web page.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a method for simulating an APP title bar in a web page, a device for simulating an APP title bar in a web page, a controller and a computer readable storage medium, where the method simulates the APP title bar in the web page, and further achieves the purpose of self-defining a function in the title bar, so that the title bar can achieve different functions according to different web page contents.
In order to solve the above technical problem, according to an aspect of the present invention, there is provided a method for simulating an APP title bar in a webpage, including:
adding a request parameter in a command requesting a URL to delete a first title bar in the APP;
detecting whether an environment for opening a webpage is the APP or not;
and when the environment for opening the webpage is detected to be the APP, creating a second title bar in the webpage.
Further, the environment of the webpage is detected through the user agent of the webpage.
Further, when it is detected that the environment for opening the webpage is the APP, the step of creating a second title bar in the webpage includes:
drawing the second title bar in the webpage, wherein the second title bar comprises a plurality of function modules;
and creating a logic relation of each functional module so that each functional module realizes the control of the webpage.
Furthermore, the method for capturing the image in the webpage and the method for simulating the APP title bar in the webpage further comprise the following steps:
when the environment for opening the webpage is detected to be the APP, adding a preset function into the APP;
initializing the preset function so as to enable data transmission between the webpage and the APP.
According to another aspect of the present invention, there is provided an apparatus for simulating an APP title bar in a web page, the apparatus comprising: the device comprises a first adding module, a detecting module and a creating module.
The first adding module is used for adding a request parameter in a URL request instruction so as to delete a first title bar in the APP;
the detection module is used for detecting whether the environment for opening the webpage is the APP or not;
and the creating module is used for creating a second title bar in the webpage when the circumstance that the webpage is opened is detected as the APP.
Further, the detection module detects the environment of the webpage through a user agent of the webpage.
Further, the creating module includes:
a drawing sub-module for drawing the second title bar in the web page, wherein the second title bar comprises a plurality of function modules;
and the creating submodule is used for creating a logic relation of each functional module so as to enable each functional module to realize the control of the webpage.
Further, the device of simulation APP title bar in the webpage still includes: a second adding module and an initializing module.
The second adding module is used for adding a preset function into the APP when the circumstance that the webpage is opened is detected to be the APP;
and the initialization module is used for initializing the preset function so as to enable the webpage and the APP to carry out data transmission.
According to a further aspect of the invention, there is provided a controller comprising a memory and a processor, the memory storing a computer program which, when executed by the processor, is capable of carrying out the steps of the method of any one of the above.
According to a further aspect of the invention, there is provided a computer readable storage medium for storing a computer program which, when executed by a computer or processor, performs the steps of the method of any one of the above.
Compared with the prior art, the invention has obvious advantages and beneficial effects. By means of the technical scheme, the method for simulating the APP title bar in the webpage and the device for simulating the APP title bar in the webpage can achieve considerable technical progress and practicability, have industrial wide utilization value and at least have the following advantages:
(1) the title bar in the APP can be simulated in the webpage through the method, so that the purpose of self-defining the function in the title bar is realized, and the title bar can realize different functions according to different webpage contents.
(2) Through adding the preset function in the APP, data transmission can be carried out between the webpage and the APP, and then the function of the first title bar in the APP can be called by the second title bar established in the webpage.
The foregoing description is only an overview of the technical solutions of the present invention, and in order to make the technical means of the present invention more clearly understood, the present invention may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Drawings
FIG. 1 is a flowchart illustrating a method for simulating an APP title bar in a webpage according to an embodiment of the present invention;
FIG. 2 is a block diagram of an apparatus for simulating an APP title bar in a webpage according to an embodiment of the present invention;
FIG. 3 is a schematic block diagram of the creation module shown in FIG. 2.
Detailed Description
To further illustrate the technical means and effects of the present invention adopted to achieve the predetermined objects, the following detailed description of the method for simulating an APP title bar in a webpage, the apparatus for simulating an APP title bar in a webpage, the controller and the computer-readable storage medium according to the present invention, and the effects thereof will be provided in conjunction with the accompanying drawings and the preferred embodiments.
The embodiment of the invention provides a method for simulating an APP title bar in a webpage, which comprises the following steps of:
in step S10, a request parameter is added to the instruction requesting the URL to delete the first title bar in the APP.
Specifically, in order to simulate the title bar in the APP in the web page, the first title bar in the WEBVIEW of the APP needs to be deleted, so as to prevent the user from having two title bars when browsing the web page, which may cause trouble to the user. In order to delete the first title bar in the APP, a request parameter is added to an instruction of a request URL (Uniform Resource Locator), and after the APP receives the request parameter, the first title bar in the WEBVIEW is deleted. It should be noted that all the parameters that enable deletion of the first title bar in the WEBVIEW may be the request parameters, and the request parameters are not limited here.
Step S20, detecting whether the environment of the open webpage is APP.
The knowable is, among the practical application, can open the webpage through the browser of PC end, also can open the webpage through the APP of cell-phone, in order to realize the title bar of simulation APP in the webpage, the environment of opening the webpage need be the APP, consequently need detect the environment of opening the webpage.
Preferably, the open environment of the web page is detected by a User Agent of the web page, wherein the User Agent (UA) enables the server to identify the open environment of the web page, and further determines whether the web page is open in the APP. Of course, other ways may also be used to detect the open environment of the web page, and details are not repeated here.
In step S30, when it is detected that the environment of the open web page is APP, a second title bar is created in the web page.
Specifically, when the user agent of the web page detects that the web page is opened in the APP, a second title bar may be created in the web page, and the second title bar may be created according to the user requirement, the website type, and the like. Such as title bar color change, directory, etc.
In an embodiment, when the second title bar is created in the web page, the second title bar may be drawn at any position in the web page, that is, the title bar is displayed in the web page, and a plurality of function modules may be drawn in the second title bar according to different functions during the drawing process. The second title bar is preferably rendered using HTML (Hyper Text Markup Language) code, but may be rendered in other ways.
Then, a logical relationship of each function module of the second title bar is created, even if the function of each function module is realized, and the control of the web page can be completed. Preferably, JavaScript code can be adopted to implement the functions of the functional modules. Of course, other ways of implementing the functions of the functional modules may be used.
In an embodiment, when it is detected through the user agent that the webpage is opened through the APP, a preset function may be further added to the APP, and the preset function may enable interaction between the webpage and the APP, that is, data transmission between the webpage and the APP is achieved.
Meanwhile, in order to ensure that the preset function can realize data transmission between the webpage and the APP, the preset function needs to be initialized, that is, whether the preset function realizes data transmission between the webpage and the APP is detected through initialization.
When the preset function is detected to realize data transmission between the webpage and the APP, the second title bar can call the function of the first title bar in the APP, such as webpage closing, sharing and the like.
Preferably, the preset function is a bridge function, and of course, data transmission between the web page and the APP may also be implemented in other manners.
The embodiment of the present invention further provides a device for simulating an APP title bar in a webpage, as shown in fig. 2, the device includes: a first adding module 10, a detecting module 20, a creating module 30.
The first adding module 10 is configured to add a request parameter in an instruction requesting a URL to delete a first title bar in an APP; the detection module 20 is configured to detect whether an environment for opening a webpage is an APP; the creating module 30 is configured to create a second title bar in the webpage when detecting that the environment for opening the webpage is APP.
Specifically, in order to simulate the title bar in the APP in the web page, the first title bar in the WEBVIEW of the APP needs to be deleted, so as to prevent the user from having two title bars when browsing the web page, which may cause trouble to the user. In order to delete the first title bar in the APP, the first adding module 10 adds a request parameter in an instruction of a request URL (Uniform Resource Locator), and deletes the first title bar in the webbiew after the APP receives the request parameter, it should be understood that only the first title bar displayed in the APP is deleted here, and the logical relationship of each function module in the first title bar is not deleted. It should be noted that all the parameters that enable deletion of the first title bar in the WEBVIEW may be the request parameters, and the request parameters are not limited here.
It can know, in practical application, can open the webpage through the browser of PC end, also can open the webpage through the APP of cell-phone, in order to realize the title bar of simulation APP in the webpage, the environment of opening the webpage needs be the APP, consequently need detect the environment of opening the webpage through detection module 20.
Preferably, the detection module 20 detects an open environment of the web page through a User Agent of the web page, wherein the User Agent (UA) enables the server to identify the open environment of the web page, and further determines whether the web page is open in the APP. Of course, other ways may also be used to detect the open environment of the web page, and details are not repeated here.
Specifically, when the creating module 30 detects that the web page is opened in the APP through the user agent of the web page, a second title bar may be created in the web page, where the second title bar may be created according to the user requirement, the website type, and the like. Such as title bar color change, directory, etc.
In one embodiment, as shown in FIG. 3, the creation module 30 includes a drawing sub-module 301 and a creation sub-module 302.
The drawing submodule 301 is configured to draw a second title bar in the web page, where the second title bar includes a plurality of function modules; the building module is used for building the logic relation of each functional module so that each functional module can realize the control of the webpage.
Specifically, when the drawing sub-module 301 creates the second title bar in the web page, the drawing of the second title bar may be performed at any position in the web page, that is, the title bar is displayed in the web page, and a plurality of function modules may be drawn by the second title bar according to different functions in the drawing process. The second title bar is preferably rendered using HTML (Hyper Text Markup Language) code, but may be rendered in other ways.
Then, the creating sub-module 302 creates a logical relationship between the functional modules of the second title bar, even if the functions of the functional modules are implemented, so as to complete the control of the web page. Preferably, JavaScript code can be adopted to implement the functions of the functional modules. Of course, other ways of implementing the functions of the functional modules may be used.
In one embodiment, as shown in fig. 2, the apparatus for simulating an APP title bar in the web page further includes: a second adding module 40 and an initializing module 50.
The second adding module 40 is configured to add a preset function to the APP when it is detected that the environment for opening the webpage is the APP; the initialization module 50 is configured to initialize a preset function so as to enable data transmission between the web page and the APP.
Specifically, when it is detected through the user agent that the webpage is opened through the APP, the second adding module 40 may further add a preset function in the APP, and the preset function may enable interaction between the webpage and the APP, that is, data transmission between the webpage and the APP is achieved.
Meanwhile, in order to ensure that the preset function can realize data transmission between the webpage and the APP, the preset function needs to be initialized by the initialization module 50, that is, whether the preset function realizes data transmission between the webpage and the APP is detected through initialization.
When the preset function is detected to realize data transmission between the webpage and the APP, the second title bar can call the function of the first title bar in the APP, such as webpage closing, sharing and the like.
Preferably, the preset function is a bridge function, and of course, data transmission between the web page and the APP may also be implemented in other manners.
An embodiment of the present invention further provides a controller, which includes a memory and a processor, where the memory stores a computer program, and the program, when executed by the processor, can implement the steps of the method.
Embodiments of the present invention also provide a computer-readable storage medium for storing a computer program, which when executed by a computer or a processor implements the steps of the method.
Although the present invention has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A method for simulating an APP title bar in a webpage is characterized by comprising the following steps:
adding a request parameter in an instruction of requesting a URL (uniform resource locator) to delete a first title bar in an APP (application), wherein the APP deletes the first title bar in a WEBVIEW after receiving the request parameter, and the request parameter is a parameter for deleting the first title bar in the WEBVIEW;
detecting whether an environment for opening a webpage is the APP or not;
and when the environment for opening the webpage is detected to be the APP, creating a second title bar in the webpage.
2. The method for simulating the APP title bar in the webpage as claimed in claim 1, wherein the environment of the webpage is detected by a user agent of the webpage.
3. The method for simulating an APP title bar in a webpage according to claim 1, wherein the step of creating a second title bar in the webpage when the circumstance that the webpage is opened is detected as the APP comprises:
drawing the second title bar in the webpage, wherein the second title bar comprises a plurality of function modules;
and creating a logic relation of each functional module so that each functional module realizes the control of the webpage.
4. The method for simulating the APP title bar in the webpage according to claim 3, further comprising:
when the environment for opening the webpage is detected to be the APP, adding a preset function into the APP;
initializing the preset function so as to enable data transmission between the webpage and the APP.
5. An apparatus for simulating an APP title bar in a web page, comprising:
a first adding module, configured to add a request parameter in an instruction requesting a URL to delete a first title bar in an APP, where the APP deletes the first title bar in the WEBVIEW after receiving the request parameter, and the request parameter is a parameter for deleting the first title bar in the WEBVIEW;
the detection module is used for detecting whether the environment for opening the webpage is the APP or not;
and the creating module is used for creating a second title bar in the webpage when the circumstance that the webpage is opened is detected as the APP.
6. The apparatus for simulating an APP title bar in a web page of claim 5, wherein the detection module detects the environment of the web page through a user agent of the web page.
7. The apparatus for simulating an APP title bar in a web page according to claim 5, wherein the creating module comprises:
a drawing sub-module for drawing the second title bar in the web page, wherein the second title bar comprises a plurality of function modules;
and the creating submodule is used for creating a logic relation of each functional module so as to enable each functional module to realize the control of the webpage.
8. The apparatus for simulating an APP title bar in a web page according to claim 7, further comprising:
the second adding module is used for adding a preset function into the APP when the circumstance that the webpage is opened is detected to be the APP;
and the initialization module is used for initializing the preset function so as to enable the webpage and the APP to carry out data transmission.
9. A controller comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, is capable of carrying out the steps of the method of any one of claims 1 to 4.
10. A computer-readable storage medium for storing a computer program which, when executed by a computer or processor, implements the steps of the method of any one of claims 1 to 4.
CN201910551480.3A 2019-06-24 2019-06-24 Method, device, controller and storage medium for simulating APP title bar in webpage Active CN110245315B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910551480.3A CN110245315B (en) 2019-06-24 2019-06-24 Method, device, controller and storage medium for simulating APP title bar in webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910551480.3A CN110245315B (en) 2019-06-24 2019-06-24 Method, device, controller and storage medium for simulating APP title bar in webpage

Publications (2)

Publication Number Publication Date
CN110245315A CN110245315A (en) 2019-09-17
CN110245315B true CN110245315B (en) 2021-09-03

Family

ID=67889172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910551480.3A Active CN110245315B (en) 2019-06-24 2019-06-24 Method, device, controller and storage medium for simulating APP title bar in webpage

Country Status (1)

Country Link
CN (1) CN110245315B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246505A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Window title bar creating method and device
CN107450904A (en) * 2017-06-07 2017-12-08 北京五八信息技术有限公司 The method for drafting and device of title bar
CN108090083A (en) * 2016-11-23 2018-05-29 北京国双科技有限公司 A kind of menu queries method and server
CN109375843A (en) * 2018-08-31 2019-02-22 平安科技(深圳)有限公司 Application search method, device, equipment and medium based on shortcut

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9268870B2 (en) * 2012-07-17 2016-02-23 Xerox Business Services, Llc Portal modularization tool
CN103064868A (en) * 2012-07-20 2013-04-24 北京飞漫软件技术有限公司 Method of adding collection/ user-defined collection of websites in hypertext markup language (HTML) 5 webpage
CN104462101B (en) * 2013-09-16 2019-01-15 联想(北京)有限公司 A kind of method and electronic equipment of information processing
CN105426448B (en) * 2015-11-06 2019-04-16 广州华多网络科技有限公司 Interface display method, apparatus and system
CN107066626A (en) * 2017-05-15 2017-08-18 惠州市德赛工业研究院有限公司 A kind of terminal collection file download storage, sort management method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246505A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Window title bar creating method and device
CN108090083A (en) * 2016-11-23 2018-05-29 北京国双科技有限公司 A kind of menu queries method and server
CN107450904A (en) * 2017-06-07 2017-12-08 北京五八信息技术有限公司 The method for drafting and device of title bar
CN109375843A (en) * 2018-08-31 2019-02-22 平安科技(深圳)有限公司 Application search method, device, equipment and medium based on shortcut

Also Published As

Publication number Publication date
CN110245315A (en) 2019-09-17

Similar Documents

Publication Publication Date Title
TWI690812B (en) Method, device and client for dynamic layout of page elements
US10241846B2 (en) Enabling a web application to call at least one native function of a mobile device
US10909304B2 (en) Methods and systems for WYSIWYG web content generation
EP2909998B1 (en) Webpages with onboard hardware functions
US20110078593A1 (en) Web browser transmission server and method of controlling operation of same
CN107943997B (en) Remote website evidence obtaining method based on Google browser, terminal device and storage medium
WO2014186489A2 (en) Enhanced links in curation and collaboration applications
US20140325323A1 (en) Online video playing method and apparatus and computer readable medium
CN103412928A (en) Method and device for realizing browser page intelligent response-type layout on mobile terminal
CN104978358B (en) The method and intercepting page segment of desktop presentation web page fragments are to desktop presentation system
CN107229760B (en) Storage medium, electronic device, the display methods of web page contents and device
CN109948077A (en) User behavior data acquisition method, device, equipment and computer storage medium
CN106569856A (en) Method and device of loading application view resource file
WO2014019507A1 (en) Method and mobile terminal device for independently playing video
CN104834588B (en) The method and apparatus for detecting resident formula cross site scripting loophole
CN106874271A (en) A kind of method and system that PC webpages are converted to mobile terminal webpage
CN107301137A (en) RSET interface realizing methods and device and electronic equipment and computer-readable recording medium
CN107124477A (en) Processing method, terminal and the server of web site contents
CN106970946A (en) A kind of page display method and device
US20240095441A1 (en) Dynamic accessibility compliance of a website
CN110674444B (en) Method and terminal for downloading dynamic webpage
CN109240756A (en) A kind of method and device of dynamically load JavaScript module
WO2015058614A1 (en) Bookmark storage method and device, and method and device for determining bookmark to be browsed
CN110245315B (en) Method, device, controller and storage medium for simulating APP title bar in webpage
CN107580253A (en) One kind reports an error page processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant