CN109284470A - Page window communication means and device - Google Patents

Page window communication means and device Download PDF

Info

Publication number
CN109284470A
CN109284470A CN201811249842.5A CN201811249842A CN109284470A CN 109284470 A CN109284470 A CN 109284470A CN 201811249842 A CN201811249842 A CN 201811249842A CN 109284470 A CN109284470 A CN 109284470A
Authority
CN
China
Prior art keywords
page
window
parameter
sent
back 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.)
Granted
Application number
CN201811249842.5A
Other languages
Chinese (zh)
Other versions
CN109284470B (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.)
Shanghai Suixun Electronic Technology Co ltd
Original Assignee
Tianjin ByteDance 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 Tianjin ByteDance Technology Co Ltd filed Critical Tianjin ByteDance Technology Co Ltd
Priority to CN201811249842.5A priority Critical patent/CN109284470B/en
Publication of CN109284470A publication Critical patent/CN109284470A/en
Application granted granted Critical
Publication of CN109284470B publication Critical patent/CN109284470B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • 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

Abstract

The disclosure proposes a kind of page window communication means and device, belongs to computer application technology.Wherein, which comprises first page utilizes second page parameter to be communicated, and invoking page opens function, to obtain the window object of second page;First page enrollment page window in the window object of second page loads call back function;First page is when detecting that load call back function is called, communication registration request is sent to second page, page parameter in communication registration request comprising the first check code and first page, so that second page is when determining that the first check code is legal, according to the page parameter of first page, the window object of first page is obtained.As a result, by this page window communication means, the two-way communication between page window is realized, user experience is improved.

Description

Page window communication means and device
Technical field
This disclosure relates to computer application technology more particularly to a kind of page window communication means and device.
Background technique
With the continuous development of Internet technology and web page program, the application range of internet constantly expands, and people are to mutual The demand of networking is also more and more advanced and complicated.For example, it is desirable to web page programs can be realized multi-screen in browser application The demand of operation, and realize this demand, it is necessary to realize being in communication with each other between multiple page windows.
In the related technology, browser provide window.postMessage method, may be implemented a page window to Another page window transmits message.But the above method, it can only realize the list of a page window and another page window To communication, the two-way communication between page window cannot achieve.
Summary of the invention
Page window communication means, device, electronic equipment and the storage medium that the disclosure proposes, for solving the relevant technologies In, the existing method by the communication between calling window.postMessage method to realize page window cannot achieve the page The problem of two-way communication between window.
The page window communication means that disclosure one side embodiment proposes, comprising: first page utilizes to be communicated the Two page parameters, invoking page opens function, to obtain the window object of the second page;The first page is described Enrollment page window loads call back function in the window object of two pages;The first page described is loaded back into letter of transfer detecting When number is called, send communication registration request to the second page, in the communication registration request comprising the first check code and The page parameter of the first page, so that the second page is when determining that first check code is legal, according to described The page parameter of one page obtains the window object of the first page.
The page window communication means that disclosure another aspect embodiment proposes, comprising: second page is during loading Registration message receives call back function;The second page calls window to load call back function when determining that load is completed, so that note The first page of volume window load call back function is when detecting that the window load call back function is called, to described the Two pages send communication registration request;The second page is obtained when detecting that the message sink call back function is called The call parameters of the message sink call back function;Whether the second page judges the first check code in the call parameters It is legal;If legal, then the second page obtains the window of first page according to the first page parameter in the call parameters Object.
The page window communication device that disclosure another further aspect embodiment proposes, comprising: obtain module, be used for first page Using second page parameter to be communicated, invoking page opens function, to obtain the window object of the second page;Register mould Block, for the first page, enrollment page window loads call back function in the window object of the second page;Send mould Block sends communication note to the second page for the first page when detecting that the load call back function is called Volume is requested, the page parameter comprising the first check code and the first page in the communication registration request, so that described second The page, according to the page parameter of the first page, obtains the first page when determining that first check code is legal Window object.
The page window communication device that the another aspect embodiment of the disclosure proposes, comprising: registration module is used for second page Registration message receives call back function during loading;Calling module is adjusted for the second page when determining that load is completed Call back function is loaded with window, so that the first page for registering the window load call back function is detecting the window load When call back function is called, communication registration request is sent to the second page;Module is obtained, is being examined for the second page Measure the message sink call back function it is called when, obtain the call parameters of the message sink call back function;Judgment module, Judge whether the first check code in the call parameters is legal for the second page;If legal, then the second page According to the first page parameter in the call parameters, the window object of first page is obtained.
The electronic equipment that the another aspect embodiment of the disclosure proposes comprising: processor and memory;Wherein, the place Reason device is corresponding with the executable program code to run by reading the executable program code stored in the memory Program, for realizing foregoing page window communication means.
The computer readable storage medium that disclosure another further aspect embodiment proposes, is stored thereon with computer program, It is characterized in that, foregoing page window communication means is realized when described program is executed by processor.
The computer program that disclosure another aspect embodiment proposes is realized as previously described when the program is executed by processor Page window communication means.
The embodiment of the present disclosure provide page window communication means, device, electronic equipment, computer readable storage medium and Computer program utilizes second page parameter to be communicated by first page, and invoking page opens function, to obtain second page The window object in face, and enrollment page window loads call back function in the window object of second page, and then first page exists When detecting that load call back function is called, communication registration request is sent to second page, includes first in communication registration request The page parameter of check code and first page, so that second page is when determining that the first check code is legal, according to first page Page parameter obtains the window object of first page.First page opens function by invoking page as a result, opens second page Face and the window object for obtaining second page, and communication registration request is sent to second page, so that second page passes through communication Registration request obtain first page window object, later first page, second page be using other side window object to Other side sends information, so that the two-way communication between realizing page window, improves user experience.
The additional aspect of the disclosure and advantage will be set forth in part in the description, and will partially become from the following description It obtains obviously, or recognized by the practice of the disclosure.
Detailed description of the invention
The disclosure is above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is a kind of flow diagram of page window communication means provided by the embodiment of the present disclosure;
Fig. 2 is the flow diagram of another kind page window communication means provided by the embodiment of the present disclosure;
Fig. 3 is the flow diagram of another kind page window communication means provided by the embodiment of the present disclosure;
Fig. 4 is a kind of signaling interaction diagram of page window communication means provided by the embodiment of the present disclosure;
Fig. 5 is a kind of structural schematic diagram of page window communication device provided by the embodiment of the present disclosure;
Fig. 6 is the structural schematic diagram of another kind page window communication device provided by the embodiment of the present disclosure;
Fig. 7 is the structural schematic diagram of a kind of electronic equipment provided by the embodiment of the present disclosure;
Fig. 8 is a kind of structural schematic diagram of non-transient computer readable storage medium provided by the embodiment of the present disclosure.
Specific embodiment
Embodiment of the disclosure is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element.The embodiments described below with reference to the accompanying drawings are exemplary, It is intended for explaining the disclosure, and should not be understood as the limitation to the disclosure.
The embodiment of the present disclosure is directed in the related technology, and existing pass through calls window.postMessage method to realize the page The method of communication between window, proposes a kind of page window communication party at the problem of cannot achieve the two-way communication between page window Method.
The page window communication means that the embodiment of the present disclosure provides is joined by first page using second page to be communicated Number, invoking page opens function, to obtain the window object of second page, and the enrollment page in the window object of second page Window loads call back function, and then first page sends to second page and communicates when detecting that load call back function is called Registration request, the page parameter comprising the first check code and first page in communication registration request, so that second page is in determination When first check code is legal, according to the page parameter of first page, the window object of first page is obtained.First page as a result, Function is opened by invoking page, open second page and obtains the window object of second page, and sends and leads to second page Believe registration request, so that second page is by the window object of communication registration request first page, first page, the later Two pages are to send information to other side using the window object of other side, so that the two-way communication between realizing page window, changes It has been apt to user experience.
Below with reference to the accompanying drawings page window communication means, device, electronic equipment, storage medium and the meter disclosure provided Calculation machine program is described in detail.
Separately below by taking the two page window sides communicated as an example, the page window provided the embodiment of the present disclosure is logical Letter method is described in detail.
First by initiate communication page window side for, to the embodiment of the present disclosure provide page window communication means into Row is described in detail.
Fig. 1 is a kind of flow diagram of page window communication means provided by the embodiment of the present disclosure, this method application In the page window for initiating communication.
As shown in Figure 1, the page window communication means, comprising the following steps:
Step 101, first page utilizes second page parameter to be communicated, and invoking page opens function, described in obtaining The window object of second page.
Wherein, second page parameter may include the uniform resource locator (Uniform of the document shown in window Resource Locator, abbreviation URL), window name, window feature, Boolean.Page open function, refers to and is used to open One new browser window or the function for searching a window named.
It should be noted that in the embodiments of the present disclosure, page open function can be window.open () function, The syntax rule of window.open () is window.open (URL, name, feature, replace).Wherein, parameter URL, name, feature, replace be respectively the URL of the document shown in the page to be opened, window name, window feature, The Boolean of window.First page can open function with invoking page, and the parameter of known second page to be communicated is made For the parameter of page open function, to open second page, and the return value of page open function is obtained, i.e. second page Window object.
Further, after getting the window object of second page, can also be stored, so as to first page with When second page is communicated, the window object of second page is called.I.e. in a kind of possible way of realization of the embodiment of the present disclosure In, after above-mentioned steps 101, can also include:
The window object of the second page is cached into variable corresponding with the second page.
Need, for store second page window object, so as to first page to second page send information When call, the corresponding variable of second page can be created in and the window object of second page named, and then will acquire is slow It deposits in the corresponding variable of value second page.For example, the variable name of the corresponding variable of second page can be set to childWindow。
Step 102, first page enrollment page window in the window object of the second page is loaded back into letter of transfer Number.
Wherein, page window loads call back function, is used to indicate whether second page loads completion.
It should be noted that if first page is just to second before all elements in second page do not load completion The page sends information, will lead to when needing to quote the element not loaded, mistake occurs.Therefore, in first page and second page Face is established before communication, and first page needs to confirm that all elements in second page have loaded completion, logical to avoid establishing Believe connection failure.
In the embodiments of the present disclosure, page window load call back function can be window.onlod function, which can It is executed after being completed with all elements load in the page, therefore, first page can be in the window object of second page Window.onload function is registered, i.e. page window loads call back function, when first page detects that page window is loaded back into When letter of transfer number is called, that is, it can determine that second page has loaded completion.
Step 103, the first page is sent out when detecting that the load call back function is called to the second page Communication registration is sent to request, the page parameter comprising the first check code and the first page in the communication registration request, so that The second page is when determining that first check code is legal, according to the page parameter of the first page, obtains described the The window object of one page.
In the embodiments of the present disclosure, first page is detected is loaded back into what it was registered in the window object of second page When letter of transfer number is called, that is, it can determine that all elements in second page have loaded completion, that is to say, that first page can be with Begin setting up the communication connection with second page.
It should be noted that first page can be sent out to second page first when establishing communication connection with second page Communication registration is sent to request, wherein the page parameter comprising the first check code and first page in communication registration request.First verification Code establishes connection for proving the legitimacy of first page, to avoid the illegal page and second page, guarantees network security.First Check code can be voluntarily preset password string, and be buffered in first page and second page, when second page receives To first page send the first check code when, it can be determined that the password string of the first check code and own cache whether one It causes, if unanimously, can determine that the first check code is legal, it can establish and communicate to connect with first page;It, can if inconsistent To determine that the first check code is illegal, it can the communication registration request that refusal first page is sent.
Correspondingly, second page can be requested according to communication registration in include first page page parameter, obtain the The window object of one page.When second page determines that the first check code is legal, it can establish and communicate to connect with first page, i.e., The window object of first page can be obtained according to the page parameter of first page, and variable corresponding with first page is set, The window object of first page is buffered in the corresponding variable of first page, so that second page can be according to first page Window object sends information to first page.For example, the variable name of the variable corresponding with first page of setting can be fatherWindow。
Further, it after first page is requested and is proved to be successful to second page transmission communication registration, can be realized Two-way communication between first page and second page.And before first page and second page send information mutually, require head Determine in caching whether include the corresponding variable of other side, first to call the window object of other side, successful delivery information.I.e. in this public affairs It opens in a kind of possible way of realization of embodiment, after above-mentioned steps 103, can also include:
Whether the first page judges corresponding comprising the second page in caching when calling delivery information function Variable, wherein the parameter for calling delivery information function is information to be sent;
If comprising, will be described according to the window object of the second page cached in the corresponding variable of the second page Information to be sent is sent to and the second page.
It should be noted that first page to second page send information when, need by call delivery information function with The corresponding variable of second page sends information to second page.But communication connection is established in first page and second page Afterwards, if first page or second page are refreshed, the page refreshed can lose the corresponding variable of another page, from And cause refresh page without normal direction another page is successfully transmitted information.Therefore, first page is sending letter to second page It before breath, can first determine whether comprising the corresponding variable of second page in caching, if comprising that can be delivered by calling Information function, and set information to be sent to the parameter of delivery information function, and then according in the corresponding variable of second page Information to be sent is sent to second page by the window object of the second page of caching.Correspondingly, second page can also lead to It crosses identical method and sends information to first page.
For example, delivery information function can be postMessage function, if the corresponding variable of first page of caching Entitled fatherWindow, the entitled childWindow of the corresponding variable of second page, then first page can pass through calling ChildWindow.postMessage sends information to second page.Correspondingly, calling can be passed through in second page FatherWindow.postMessage sends information to first page.
Further, if first page or second page send information to other side, determine do not include another in caching The corresponding variable of the page, i.e., its refreshed after establishing communication connection with another page, then can will be to be sent Information cache, with re-established with another page connect after information to be sent is sent to another page again.I.e. In a kind of possible way of realization of the embodiment of the present disclosure, after above-mentioned steps 103, can also include:
If not including the corresponding variable of the second page in caching, by the information to be sent with the second page Face is identified as in index deposit dropout array.
It should be noted that if determining do not include second page in caching when first page sends information to second page Corresponding variable can then determine the refreshing for being that second page is established after communication connection, and first page carries out, to lose Reference to second page, no normal direction second page send information.Therefore, in a kind of possible realization shape of the embodiment of the present disclosure In formula, when not variable corresponding comprising second page in caching, first page can be by information to be sent with second page The index that is identified as be stored in so that in information array, will be pending after re-establishing connection with first page and second page Breath of delivering letters is retransmitted page window is improved to second page between the reliability transmitted of information.Wherein, dropout array can be with It is preset in advance.Correspondingly, if determining do not include first page pair in caching when second page sends information to first page Information to be sent can also be stored in dropout array using identical method by the variable answered.
The page window communication means that the embodiment of the present disclosure provides is joined by first page using second page to be communicated Number, invoking page opens function, to obtain the window object of second page, and the enrollment page in the window object of second page Window loads call back function, and then first page sends to second page and communicates when detecting that load call back function is called Registration request, the page parameter comprising the first check code and first page in communication registration request, so that second page is in determination When first check code is legal, according to the page parameter of first page, the window object of first page is obtained.First page as a result, Function is opened by invoking page, open second page and obtains the window object of second page, and sends and leads to second page Believe registration request, so that second page is by the window object of communication registration request first page, first page, the later Two pages are to send information to other side using the window object of other side, so that the two-way communication between realizing page window, changes It has been apt to user experience.
In a kind of possible way of realization of the disclosure, if after first page and second page establish communication connection, In a page carried out refresh operation, then the information that can be sent by non-refresh page to refresh page, reacquire The com object of non-refresh page, to re-establish communication connection with non-refresh page.
Below with reference to Fig. 2, the page window communication means provided the embodiment of the present disclosure is further described.
Fig. 2 is the flow diagram of another kind page window communication means provided by the embodiment of the present disclosure.
As shown in Fig. 2, the page window communication means, comprising the following steps:
Step 201, first page disappears described in acquisition when the message sink call back function for detecting first page is called Breath receives the call parameters of call back function.
Wherein, the message sink call back function of first page is to register in first page load, for receiving other The information that the page is sent to first page.For example, message sink call back function can with when window.onmessage function.
It should be noted that when first page receives the information of other pages transmission, it can be by calling message to connect Call back function is received, the parameter of the delivery information function called when other pages send information to first page is obtained, and will be called Call parameters of the parameter of the delivery information function got as the message sink call back function of first page.
Step 202, judge in the call parameters whether include the second page parameter, if so, thening follow the steps 203;It is no to then follow the steps 205.
Step 203, the window object of the second page is obtained according to the parameter of the second page.
It should be noted that the call parameters of the message sink call back function of first page, are sent out according to first page Deliver letters breath page invocation delivery information function parameter determine, and in the parameter of delivery information include information to be sent, The parameter information of the type of information to be sent, the current state of invoking page and invoking page therefore can be by judging In the call parameters of the message sink call back function of one page, if the parameter comprising second page, to determine to first page Whether the page for sending information is second page.If in call parameters including the parameter of second page, can determine when it is preceding to It is second page that first page, which sends information, it can the parameter of second page is obtained by call parameters, and according to second The parameter of the page obtains the window object of second page, and will be buffered in the corresponding variable of second page, to re-establish the Communication connection between one page and second page.
Further, it when being communicated between page window, can be sent together with check code by information to be sent, so as to The legitimacy of the page is sent in the page verification for receiving information, improves the safety of page communication.I.e. in the embodiment of the present disclosure one In the possible way of realization of kind, before above-mentioned steps 203, can also include:
Determine that the first check code in the call parameters is legal.
It should be noted that first page can by judge the first check code in call parameters whether with it is default and delay The password string deposited is consistent, determines the legitimacy of the first check code.Specifically, if the first check code in call parameters and slow The password string deposited is consistent, then can determine that the first check code is legal, it can obtain the window object of second page, and with Second page establishes communication connection;It, can be with if the password string of the first check code and caching in call parameters is inconsistent Determine that the first check code is illegal, it can not obtain the window object of second page, refusal establishes communication link with second page It connects.
Step 204, according to the window object of the second page, by the dropout array with the second page The information to be sent for being identified as index, be sent to the second page.
In the embodiments of the present disclosure, after first page gets the window object of second page, i.e., with second page weight It is new to establish after communication connection, it can according to the window object of second page, determine in dropout data whether comprising with Second page is identified as the information to be sent of index.If comprising can be by calling delivery information function that this pending is delivered letters Breath, be sent to second page, to avoid because between first page and second page communication connection disconnect, caused by page window Communication abnormality between mouthful.
Further, it will be delivered letters in first page in dropout array with the pending of index that be identified as of second page Breath, is sent to after second page, is failed with the information to be sent for being identified as index of second page.Therefore, in the disclosure In a kind of possible way of realization of embodiment, after above-mentioned steps 204, can also include:
Remove the information to be sent for being identified as index in the dropout array with the second page.
It should be noted that in first page the to be sent of index will be identified as with second page in dropout array Information is sent to after second page, will become invalid information with the information to be sent for being identified as index of second page, and If the information to be sent sent is continued to be stored in dropout array, first page next time and second page weight will cause It newly establishes after connection, repeats the information to be sent for being identified as index with second page sent to be sent to second page Face.Therefore, which can be removed from dropout array, to save spatial cache, and avoids pending deliver letters The repetition of breath is sent, and influences the normal communication between page window.
Step 205, according to the parameter of the third page in the call parameters, the window object of the third page is obtained.
It should be noted that may be implemented between multiple pages in a kind of possible way of realization of the embodiment of the present disclosure Be in communication with each other, therefore, first page in the call parameters for determining message sink call back function do not include second page ginseng When number, then when the preceding third page for sending information to first page, it may be possible to establish communication with first page before other The new page of communication connection is established in the page of connection, or request with first page, i.e. first page can also be according to tune With the parameter for the third page for including in function, the window object of the third page is obtained, and caches and is that the third page is corresponding In variable, the communication connection between first page and the third page is established.
Further, the page of communication connection was established before may be due to the third page with first page, it is also possible to It is the new page that communication connection is established in request with first page, and hence it is also possible to which it is failed to determine whether there is first page It is sent to the information to be sent of the third page.I.e. in a kind of possible way of realization of the embodiment of the present disclosure, above-mentioned steps 205 it Afterwards, can also include:
Whether judge in the dropout array comprising with the information to be sent for being identified as index of the third page;
If comprising, according to the window object of the third page, by the dropout array with the third page It is identified as the information to be sent of index, is sent to the third page.
It is understood that in the embodiments of the present disclosure, can judge dropout according to the window object of the third page Whether comprising with the information to be sent for being identified as index of the third page in array.If comprising that can determine that the third page is The page communicated was established with first page before, it can, will be in dropout array according to the window object of the third page With the information to be sent for being identified as index of the third page, it is sent to the third page, and remove in dropout array with third The information to be sent for being identified as index of the page.
The page window communication means that the embodiment of the present disclosure provides, by first page in the message for detecting first page Receive call back function it is called when, obtain the call parameters of message sink call back function, and include the in judge call parameters When the parameter of two pages, the window object of second page is obtained according to the parameter of second page, and then according to the window of second page Mouth object, with the information to be sent for being identified as index of second page, will be sent to the second page in dropout array; Otherwise, according to the parameter of the third page in call parameters, the window object of the third page is obtained.First page is by disappearing as a result, Breath receives the call parameters of call back function, and according to the page parameter for including in call parameters, obtains the window object of the page, with The page disconnected before re-establishes communication connection, and the information to be sent in dropout array is sent to accordingly The page to not only realize the two-way communication between page window, but also re-establishes after a page window refreshing wherein Communication connection between page window, further improves user experience.
Below by taking the page window side for receiving communication request as an example, to the page window communication party of embodiment of the present disclosure offer Method is described in detail.
The page window communication means that the embodiment of the present disclosure provides is further described below with reference to Fig. 3.
Fig. 3 is the flow diagram of another kind page window communication means provided by the embodiment of the present disclosure, and this method is answered Page window for communication request.
As shown in figure 3, the page window side of the communication request, comprising the following steps:
Step 301, the second page calls window to load call back function when determining that load is completed, so that registration institute The first page of window load call back function is stated when detecting that the window load call back function is called, to the second page Face sends communication registration request.
Wherein, window loads call back function, refers to and opens the first page that function opens second page by invoking page, It is being registered in second page, be used to indicate the function whether second page loads completion.For example, window load call back function can To be window.onlod function.
It should be noted that if first page is just to second before all elements in second page do not load completion The page sends information, will lead to when needing to quote the element not loaded, mistake occurs.Therefore, second page is completed in load When, soon call window load call back function that can be sent to it to notify first page, second page to load completion Communication registration request.
Step 302, the second page obtains the message when detecting that the message sink call back function is called Receive the call parameters of call back function.
Wherein, the message sink call back function of second page is to register in second page load, for receiving other The information that the page is sent to second page.For example, message sink call back function can with when window.onmessage function.
It should be noted that when second page receives the information of other pages transmission, the message sink of second page Call back function can be called, and obtain the parameter of the delivery information function called when other pages send information to second page, and Call parameters of the parameter for the delivery information function that will acquire as the message sink call back function of second page.
Step 303, the second page judges whether the first check code in the call parameters is legal.
Wherein, the first check code is established for proving the legitimacy of first page to avoid the illegal page and second page Connection guarantees network security.First check code may be embodied in request and second page establishes the first page hair of communication connection It further include the page parameter of first page in the communication registration request sent, in communication registration request.
It should be noted that the call parameters of the message sink call back function of second page, are sent out according to second page Deliver letters breath first page call delivery information function parameter determine, and in the parameter of delivery information include letter to be sent Therefore the parameter information of breath, the type of information to be sent, the current state of invoking page and invoking page can pass through The information to be sent for including in the call parameters of the message sink call back function of two pages determines the first school that first page is sent Code is tested, and then determines whether the first check code is legal.
Further, the whether legal password string of the first check code of verifying can be preset, and according to the first check code It is whether consistent with preset password string, judge whether the first check code is legal.It is i.e. possible in embodiment of the present disclosure one kind In way of realization, above-mentioned steps 303 may include:
The second page judges first check code, and if preset corresponding with first page mark The matching of two check codes.
It should be noted that the different pages can be preset not in a kind of possible way of realization of the embodiment of the present disclosure The second same check code that is, for verifying the whether legal password string of the first check code, and is identified as index with the page Corresponding second check code of each page is cached, connection is established to avoid the illegal page and second page, further increases the page The safety communicated between window.
Specifically, if the second check code matching corresponding with first page mark of the first check code, can determine first Check code is legal;If the first check code the second check code corresponding with first page mark mismatches, the first school can be determined It tests that code is illegal, and refuses the communication registration request of first page.
Step 304, if legal, then the second page obtains the according to the first page parameter in the call parameters The window object of one page.
In the embodiments of the present disclosure, it if second page determines that the first check code is legal, can be established with first page logical Letter connection, and according to the page parameter of first page in call parameters, the window object of first page is obtained, and be arranged and first The window object of first page is buffered in the corresponding variable of first page, so that second page can by the corresponding variable of the page To send information to first page according to the window object of first page.For example, the variable corresponding with first page of setting Variable name can be fatherWindow.
The page window communication means that the embodiment of the present disclosure provides is called through second page when determining that load is completed Window loads call back function, so that the first page of log-in window load call back function is detecting window load call back function quilt When calling, communication registration request is sent to second page, second page is obtained when detecting that message sink call back function is called Message is taken to receive the call parameters of call back function, and when determining that the first check code in call parameters is legal, second page root According to the first page parameter in call parameters, the window object of first page is obtained.Second page is loaded by window and is adjusted as a result, First page is notified with function, has loaded completion, so that first page is sent to it communication registration request, and is connect according to message The call parameters for receiving call back function obtain the window object of first page, and first page, second page are i.e. using other side later Window object to other side send information, so that the two-way communication between realizing page window, improves user experience.
Fig. 4 is a kind of signaling interaction diagram of page window communication means provided by the embodiment of the present disclosure.
As shown in figure 4, the page window communication means, comprising the following steps:
Step 401, first page utilizes second page parameter to be communicated, and invoking page opens function, to obtain second The window object of the page.
Step 402, registration message receives call back function to second page during loading.
Step 403, second page calls window to load call back function when determining that load is completed.
Step 404, first page sends communication registration to second page and asks when detecting that load call back function is called It asks.
Wherein, the page parameter comprising the first check code and first page in communication registration request, so that second page exists When determining that the first check code is legal, according to the page parameter of first page, the window object of first page is obtained.
Step 405, second page obtains message sink call back function when detecting that message sink call back function is called Call parameters.
Step 406, second page judges whether the first check code in call parameters is legal;
Step 407, if legal, then second page obtains first page according to the first page parameter in call parameters Window object.
The above process utilizes second page parameter to be communicated by first page, and invoking page opens function, to obtain The window object of second page, registration message receives call back function to second page during loading, and is determining load completion When, call window to load call back function, first page is sent logical when detecting that load call back function is called to second page Believe registration request, second page obtains the tune of message sink call back function when detecting that message sink call back function is called With parameter, and judge whether the first check code in call parameters is legal, and if legal, then second page is according in call parameters First page parameter obtains the window object of first page.First page opens function by invoking page as a result, opens the Two pages and the window object for obtaining second page, and communication registration request is sent to second page, so that second page passes through The window object of communication registration request first page, first page, second page are the window pair using other side later As sending information to other side, so that the two-way communication between realizing page window, improves user experience.
In order to realize above-described embodiment, the disclosure also proposes a kind of page window communication device.
Fig. 5 is a kind of structural schematic diagram for page window communication device that the embodiment of the present disclosure provides, and is applied to initiate logical The page window of letter.
As shown in figure 5, the page window communication device 50, comprising:
First obtains module 501, utilizes second page parameter to be communicated for first page, invoking page opens letter Number, to obtain the window object of the second page;
Registration module 502, for the first page, enrollment page window adds in the window object of the second page Carry call back function;
First sending module 503, for the first page when detecting that the load call back function is called, to institute It states second page and sends communication registration request, the page comprising the first check code and the first page in the communication registration request Face parameter, so that the second page is when determining that first check code is legal, according to the page parameter of the first page, Obtain the window object of the first page.
In actual use, the page window communication device that the embodiment of the present disclosure provides, can be configured in any electronics In equipment, to execute aforementioned page window communication means.
The page window communication device that the embodiment of the present disclosure provides is joined by first page using second page to be communicated Number, invoking page opens function, to obtain the window object of second page, and the enrollment page in the window object of second page Window loads call back function, and then first page sends to second page and communicates when detecting that load call back function is called Registration request, the page parameter comprising the first check code and first page in communication registration request, so that second page is in determination When first check code is legal, according to the page parameter of first page, the window object of first page is obtained.First page as a result, Function is opened by invoking page, open second page and obtains the window object of second page, and sends and leads to second page Believe registration request, so that second page is by the window object of communication registration request first page, first page, the later Two pages are to send information to other side using the window object of other side, so that the two-way communication between realizing page window, changes It has been apt to user experience.
In a kind of possible way of realization of the disclosure, above-mentioned page window communication device 50, further includes:
Cache module 504, for caching the window object of the second page to change corresponding with the second page In amount.
In the alternatively possible way of realization of the disclosure, above-mentioned page window communication device 50, further includes:
First judgment module 505 judges whether wrap in caching for the first page when calling delivery information function Containing the corresponding variable of the second page, wherein the parameter for calling delivery information function is information to be sent;
If comprising, will be described according to the window object of the second page cached in the corresponding variable of the second page Information to be sent is sent to and the second page.
In the disclosure in another possible way of realization, above-mentioned page window communication device 50, further includes:
Memory module 506 will be described to be sent when for being not comprising the corresponding variable of the second page in the buffer Information with the second page being identified as index deposit dropout array in.
In the disclosure in another possible way of realization, above-mentioned page window communication device 50, further includes:
Second obtains module 507, for the first page in the message sink call back function quilt for detecting first page When calling, the call parameters of the message sink call back function are obtained;
Second judgment module 508, for judge in the call parameters whether include the second page parameter;
If comprising obtaining the window object of the second page according to the parameter of the second page;
Second sending module 509, for the window object according to the second page, by the dropout array with The information to be sent for being identified as index of the second page, is sent to the second page.
In the alternatively possible way of realization of the disclosure, above-mentioned page window communication device 50, further includes:
Third obtains module 510, when in the call parameters not including the parameter of the second page, according to the tune With the parameter of the third page in parameter, the window object of the third page is obtained;
Third judgment module 511, for whether judging in the dropout array comprising being identified as with the third page The information to be sent of index;
If comprising, according to the window object of the third page, by the dropout array with the third page It is identified as the information to be sent of index, is sent to the third page.
In the disclosure in another possible way of realization, above-mentioned page window communication device 50, further includes:
Determining module 512, for determining that the first check code in the call parameters is legal.
In the disclosure in another possible way of realization, above-mentioned page window communication device 50, further includes:
Remove module 513, for remove in the dropout array with the second page be identified as index to Send information.
It should be noted that the aforementioned explanation to Fig. 1, Fig. 2, Fig. 3 or page window communication means embodiment shown in Fig. 4 Illustrate the pushed information display device 50 for being also applied for the embodiment, details are not described herein again.
The page window communication device that the embodiment of the present disclosure provides, by first page in the message for detecting first page Receive call back function it is called when, obtain the call parameters of message sink call back function, and include the in judge call parameters When the parameter of two pages, the window object of second page is obtained according to the parameter of second page, and then according to the window of second page Mouth object, with the information to be sent for being identified as index of second page, will be sent to the second page in dropout array; Otherwise, according to the parameter of the third page in call parameters, the window object of the third page is obtained.First page is by disappearing as a result, Breath receives the call parameters of call back function, and according to the page parameter for including in call parameters, obtains the window object of the page, with The page disconnected before re-establishes communication connection, and the information to be sent in dropout array is sent to accordingly The page to not only realize the two-way communication between page window, but also re-establishes after a page window refreshing wherein Communication connection between page window, further improves user experience.
In order to realize above-described embodiment, the disclosure also proposes another page window communication device.
Fig. 6 is the structural schematic diagram for another page window communication device that the embodiment of the present disclosure provides, and is applied to receive The page window side of communication request.
As shown in fig. 6, the page window communication device 60, comprising:
Registration module 61, for second page, registration message receives call back function during loading;
Calling module 62 calls window to load call back function for the second page when determining that load is completed, so that The first page of window load call back function is registered when detecting that the window load call back function is called, to described Second page sends communication registration request;
Module 63 is obtained, for the second page when detecting that the message sink call back function is called, is obtained The call parameters of the message sink call back function;
Judgment module 64 judges whether the first check code in the call parameters is legal for the second page;
If legal, then the second page obtains first page according to the first page parameter in the call parameters Window object.
In actual use, the page window communication device that the embodiment of the present disclosure provides, can be configured in any electronics In equipment, to execute aforementioned page window communication means.
The page window communication device that the embodiment of the present disclosure provides is called through second page when determining that load is completed Window loads call back function, so that the first page of log-in window load call back function is detecting window load call back function quilt When calling, communication registration request is sent to second page, second page is obtained when detecting that message sink call back function is called Message is taken to receive the call parameters of call back function, and when determining that the first check code in call parameters is legal, second page root According to the first page parameter in call parameters, the window object of first page is obtained.Second page is loaded by window and is adjusted as a result, First page is notified with function, has loaded completion, so that first page is sent to it communication registration request, and is connect according to message The call parameters for receiving call back function obtain the window object of first page, and first page, second page are i.e. using other side later Window object to other side send information, so that the two-way communication between realizing page window, improves user experience.
In a kind of possible way of realization of the disclosure, above-mentioned judgment module 64 is specifically used for:
The second page judges first check code, and if preset corresponding with first page mark The matching of two check codes.
It should be noted that the aforementioned explanation to Fig. 1, Fig. 2, Fig. 3 or page window communication means embodiment shown in Fig. 4 Illustrate the pushed information display device 60 for being also applied for the embodiment, details are not described herein again.
The page window communication device that the embodiment of the present disclosure provides is called through second page when determining that load is completed Window loads call back function, so that the first page of log-in window load call back function is detecting window load call back function quilt When calling, communication registration request is sent to second page, second page is obtained when detecting that message sink call back function is called Message is taken to receive the call parameters of call back function, and when determining that the first check code in call parameters is legal, second page root According to the first page parameter in call parameters, the window object of first page is obtained.Second page is loaded by window and is adjusted as a result, First page is notified with function, has loaded completion, so that first page is sent to it communication registration request, and is connect according to message The call parameters for receiving call back function obtain the window object of first page, and first page, second page are i.e. using other side later Window object to other side send information, so that the two-way communication between realizing page window, improves user experience.
In order to realize above-described embodiment, the disclosure also proposes a kind of electronic equipment.
Fig. 7 is the structural schematic diagram for the electronic equipment that the embodiment of the present disclosure provides.
Below with reference to Fig. 7, it illustrates the structural representations for the electronic equipment 700 for being suitable for being used to realize the embodiment of the present disclosure Figure.Terminal device in the embodiment of the present disclosure can include but is not limited to such as mobile phone, laptop, digital broadcasting and connect Receive device, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle Carry navigation terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electricity shown in Fig. 7 Sub- equipment is only an example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in fig. 7, electronic equipment 700 may include processing unit (such as central processing unit, graphics processor etc.) 701, random access can be loaded into according to the program being stored in read-only memory (ROM) 702 or from storage device 708 Program in memory (RAM) 703 and execute various movements appropriate and processing.In RAM 703, it is also stored with electronic equipment Various programs and data needed for 700 operations.Processing unit 701, ROM 702 and RAM 703 pass through the phase each other of bus 704 Even.Input/output (I/O) interface 705 is also connected to bus 704.
In general, following device can connect to I/O interface 705: including such as touch screen, touch tablet, keyboard, mouse, taking the photograph As the input unit 706 of head, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaker, vibration The output device 707 of dynamic device etc.;Storage device 708 including such as tape, hard disk etc.;And communication device 709.Communication dress It sets 709 and can permit electronic equipment 700 and wirelessly or non-wirelessly communicated with other equipment to exchange data.Although Fig. 7 is shown Electronic equipment 700 with various devices, it should be understood that being not required for implementing or having all devices shown.It can Alternatively to implement or have more or fewer devices.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 709, or from storage device 708 It is mounted, or is mounted from ROM 702.When the computer program is executed by processing unit 701, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: obtaining at least two internet protocol addresses;Send to Node evaluation equipment includes institute State the Node evaluation request of at least two internet protocol addresses, wherein the Node evaluation equipment is internet from described at least two In protocol address, chooses internet protocol address and return;Receive the internet protocol address that the Node evaluation equipment returns;Its In, the fringe node in acquired internet protocol address instruction content distributing network.
Alternatively, above-mentioned computer-readable medium carries one or more program, when said one or multiple programs When being executed by the electronic equipment, so that the electronic equipment: receiving the Node evaluation including at least two internet protocol addresses and request; From at least two internet protocol address, internet protocol address is chosen;Return to the internet protocol address selected;Wherein, The fringe node in internet protocol address instruction content distributing network received.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
It should be noted that the implementation process and technical principle of the electronic equipment of the present embodiment are referring to aforementioned to disclosure reality The explanation of the page window communication means of example is applied, details are not described herein again.
The electronic equipment that the embodiment of the present disclosure provides, can execute foregoing page window communication means, by the One page utilizes second page parameter to be communicated, and invoking page opens function, to obtain the window object of second page, and Enrollment page window loads call back function in the window object of second page, and then first page is detecting load call back function When called, communication registration request is sent to second page, includes the first check code and first page in communication registration request Page parameter, so that second page when determining that the first check code is legal, according to the page parameter of first page, obtains first page The window object in face.First page opens function by invoking page as a result, opens second page and obtains the window of second page Mouth object, and communication registration request is sent to second page, so that second page passes through communication registration request first page Window object, later first page, second page be using other side window object to other side send information, to realize Two-way communication between page window, improves user experience.
In order to realize above-described embodiment, the disclosure also proposes a kind of non-transient computer readable storage medium, stores thereon There is computer program, which realizes page window communication means as in the foregoing embodiment when being executed by processor.
Fig. 8 is the schematic diagram for illustrating computer readable storage medium according to an embodiment of the present disclosure.As shown in figure 8, root According to the computer readable storage medium 800 of the embodiment of the present disclosure, it is stored thereon with non-transient computer readable instruction 810.When this When non-transient computer readable instruction 810 is run by processor, the page window communication of each embodiment of the disclosure above-mentioned is executed The all or part of the steps of method.
In order to realize above-described embodiment, disclosure another further aspect embodiment provides a kind of computer program, which is located When managing device execution, to realize page window communication means described in the embodiment of the present disclosure.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is contained at least one embodiment or example of the disclosure.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the disclosure, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the disclosure includes other realization, wherein can not press shown or discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be by the disclosure Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the disclosure can be realized with hardware, software, firmware or their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware in another embodiment, following skill well known in the art can be used Any one of art or their combination are realized: have for data-signal is realized the logic gates of logic function from Logic circuit is dissipated, the specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, can integrate in a processing module in each functional unit in each embodiment of the disclosure It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above Embodiment of the disclosure is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the disclosure System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of this disclosure Type.

Claims (14)

1. a kind of page window communication means characterized by comprising
First page utilizes second page parameter to be communicated, and invoking page opens function, to obtain the window of the second page Mouth object;
First page enrollment page window in the window object of the second page loads call back function;
The first page sends communication registration to the second page and asks when detecting that the load call back function is called It asks, the page parameter comprising the first check code and the first page in the communication registration request, so that the second page When determining that first check code is legal, according to the page parameter of the first page, the window of the first page is obtained Object.
2. the method as described in claim 1, which is characterized in that after the window object for obtaining the second page, also Include:
The window object of the second page is cached into variable corresponding with the second page.
3. method according to claim 2, which is characterized in that the window object by the second page cache to institute After stating in the corresponding variable of second page, further includes:
Whether the first page judges in caching when calling delivery information function comprising the corresponding change of the second page Amount, wherein the parameter for calling delivery information function is information to be sent;
If comprising, will be described pending according to the window object of the second page cached in the corresponding variable of the second page The information sent is sent to and the second page.
4. method as claimed in claim 3, which is characterized in that described to judge whether correspond to comprising the second page in caching Variable after, further includes:
If not including, the information to be sent is identified as index deposit dropout array with the second page In.
5. method as claimed in claim 4, which is characterized in that it is described by the information to be sent with the second page After being identified as in index deposit dropout array, further includes:
The first page obtains the message sink and returns when the message sink call back function for detecting first page is called The call parameters of letter of transfer number;
Judge in the call parameters whether include the second page parameter;
If comprising obtaining the window object of the second page according to the parameter of the second page;
According to the window object of the second page, index will be identified as with the second page in the dropout array Information to be sent, be sent to the second page.
6. method as claimed in claim 5, which is characterized in that described whether to judge in the call parameters comprising described second After the parameter of the page, further includes:
If not including, according to the parameter of the third page in the call parameters, the window object of the third page is obtained;
Whether judge in the dropout array comprising with the information to be sent for being identified as index of the third page;
If comprising, according to the window object of the third page, by the dropout array with the mark of the third page For the information to be sent of index, it is sent to the third page.
7. such as method described in claim 5 or 6, which is characterized in that described according to the acquisition of the parameter of the second page Before the window object of second page, further includes:
Determine that the first check code in the call parameters is legal.
8. such as method described in claim 5 or 6, which is characterized in that it is described by the dropout array with described second The information to be sent for being identified as index of the page, is sent to after the second page, further includes:
Remove the information to be sent for being identified as index in the dropout array with the second page.
9. a kind of page window communication means characterized by comprising
Registration message receives call back function to second page during loading;
The second page is called window to load call back function, is loaded back into so as to register the window when determining that load is completed The first page of letter of transfer number sends communication note when detecting that the window load call back function is called, to the second page Volume request;
The second page obtains the message sink call back function when detecting that the message sink call back function is called Call parameters;
The second page judges whether the first check code in the call parameters is legal;
If legal, then the second page obtains the window of first page according to the first page parameter in the call parameters Object.
10. method as claimed in claim 9, which is characterized in that the second page judges first in the call parameters Whether check code is legal, comprising:
The second page judges first check code, and if preset the second school corresponding with first page mark Test code matching.
11. a kind of page window communication device characterized by comprising
Module is obtained, utilizes second page parameter to be communicated for first page, invoking page opens function, described in obtaining The window object of second page;
Registration module, for the first page, enrollment page window is loaded back into letter of transfer in the window object of the second page Number;
Sending module, for the first page when detecting that the load call back function is called, to the second page Communication registration request is sent, includes the page parameter of the first check code and the first page in the communication registration request, with Make the second page when determining that first check code is legal, according to the page parameter of the first page, described in acquisition The window object of first page.
12. a kind of page window communication device characterized by comprising
Registration module, for second page, registration message receives call back function during loading;
Calling module calls window to load call back function for the second page when determining that load is completed, so that registration institute The first page of window load call back function is stated when detecting that the window load call back function is called, to the second page Face sends communication registration request;
Module is obtained to disappear described in acquisition for the second page when detecting that the message sink call back function is called Breath receives the call parameters of call back function;
Judgment module judges whether the first check code in the call parameters is legal for the second page;
If legal, then the second page obtains the window of first page according to the first page parameter in the call parameters Object.
13. a kind of electronic equipment, which is characterized in that including processor and memory;
Wherein, the processor is run by reading the executable program code stored in the memory can be performed with described The corresponding program of program code, for realizing the page window communication means as described in any in claim 1-8 or 9-10.
14. a kind of non-transient computer readable storage medium, is stored thereon with computer program, which is characterized in that the program quilt When processor executes, the page window communication means as described in claim 1-8 or 9-10 are any is realized.
CN201811249842.5A 2018-10-25 2018-10-25 Page window communication method and device Active CN109284470B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811249842.5A CN109284470B (en) 2018-10-25 2018-10-25 Page window communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811249842.5A CN109284470B (en) 2018-10-25 2018-10-25 Page window communication method and device

Publications (2)

Publication Number Publication Date
CN109284470A true CN109284470A (en) 2019-01-29
CN109284470B CN109284470B (en) 2020-12-04

Family

ID=65177945

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811249842.5A Active CN109284470B (en) 2018-10-25 2018-10-25 Page window communication method and device

Country Status (1)

Country Link
CN (1) CN109284470B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815429A (en) * 2019-01-31 2019-05-28 天津字节跳动科技有限公司 Browser page closes treating method and apparatus
CN111625432A (en) * 2019-02-28 2020-09-04 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN112968888A (en) * 2021-02-04 2021-06-15 慧影医疗科技(北京)有限公司 Double-screen interaction method and system for medical images
CN113282865A (en) * 2021-06-24 2021-08-20 广州欢网科技有限责任公司 Page access data acquisition method and device
CN114827231A (en) * 2022-04-11 2022-07-29 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on local storage of browser

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060121430A (en) * 2005-05-24 2006-11-29 주식회사 데이콤멀티미디어인터넷 Service system for direct download software contents and method thereof
CN103246667A (en) * 2012-02-08 2013-08-14 腾讯科技(深圳)有限公司 Method and device for cross-domain transfer of data
CN103309877A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Method and device for cross-domain communication and full-duplex communication
CN106339264A (en) * 2016-08-29 2017-01-18 九次方财富资讯(北京)有限责任公司 Method and system for showing dual-publicity data web page realized based on Ajax asynchronous call technology
CN106469056A (en) * 2015-08-19 2017-03-01 三星电子株式会社 For providing the apparatus and method of information in the electronic device
CN106777184A (en) * 2016-12-22 2017-05-31 北京猎豹移动科技有限公司 A kind of page loading method, device and electronic equipment
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN107066618A (en) * 2017-05-09 2017-08-18 灯塔财经信息有限公司 Display methods and device after a kind of Webpage conversion
CN107315646A (en) * 2016-04-27 2017-11-03 北京京东尚科信息技术有限公司 Data flow control method and device between page assembly
CN107678863A (en) * 2016-08-01 2018-02-09 北京国双科技有限公司 The page assembly means of communication and device
CN108182131A (en) * 2017-12-13 2018-06-19 东软集团股份有限公司 Monitor method, apparatus, storage medium and the electronic equipment of application operation state

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20060121430A (en) * 2005-05-24 2006-11-29 주식회사 데이콤멀티미디어인터넷 Service system for direct download software contents and method thereof
CN103246667A (en) * 2012-02-08 2013-08-14 腾讯科技(深圳)有限公司 Method and device for cross-domain transfer of data
CN103309877A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Method and device for cross-domain communication and full-duplex communication
CN106469056A (en) * 2015-08-19 2017-03-01 三星电子株式会社 For providing the apparatus and method of information in the electronic device
CN107315646A (en) * 2016-04-27 2017-11-03 北京京东尚科信息技术有限公司 Data flow control method and device between page assembly
CN107678863A (en) * 2016-08-01 2018-02-09 北京国双科技有限公司 The page assembly means of communication and device
CN106339264A (en) * 2016-08-29 2017-01-18 九次方财富资讯(北京)有限责任公司 Method and system for showing dual-publicity data web page realized based on Ajax asynchronous call technology
CN106777184A (en) * 2016-12-22 2017-05-31 北京猎豹移动科技有限公司 A kind of page loading method, device and electronic equipment
CN106897215A (en) * 2017-01-20 2017-06-27 华南理工大学 A kind of method gathered based on WebView webpages loading performance and user behavior flow data
CN107066618A (en) * 2017-05-09 2017-08-18 灯塔财经信息有限公司 Display methods and device after a kind of Webpage conversion
CN108182131A (en) * 2017-12-13 2018-06-19 东软集团股份有限公司 Monitor method, apparatus, storage medium and the electronic equipment of application operation state

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘其成等: "不同浏览器页面窗口中的Java Applet间的通信", 《微型机与应用》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815429A (en) * 2019-01-31 2019-05-28 天津字节跳动科技有限公司 Browser page closes treating method and apparatus
CN109815429B (en) * 2019-01-31 2021-03-05 天津字节跳动科技有限公司 Browser page closing processing method and device
CN111625432A (en) * 2019-02-28 2020-09-04 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN111625432B (en) * 2019-02-28 2023-03-28 北京字节跳动网络技术有限公司 Page loading time consumption determination method and device and computer readable storage medium
CN112968888A (en) * 2021-02-04 2021-06-15 慧影医疗科技(北京)有限公司 Double-screen interaction method and system for medical images
CN113282865A (en) * 2021-06-24 2021-08-20 广州欢网科技有限责任公司 Page access data acquisition method and device
CN114827231A (en) * 2022-04-11 2022-07-29 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on local storage of browser
CN114827231B (en) * 2022-04-11 2023-09-26 杭州指令集智能科技有限公司 Method and system for realizing multi-window point-to-point communication based on browser local storage

Also Published As

Publication number Publication date
CN109284470B (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN109284470A (en) Page window communication means and device
CN107070735B (en) Method, test terminal and the system of asynchronous interface test
US9825943B2 (en) Location determination for user authentication
CN105659558B (en) Computer implemented method, authorization server and computer-readable memory
CN104737175B (en) The method implemented by computer and system, computer-readable media
CN110069941A (en) A kind of interface access authentication method, apparatus and computer-readable medium
US7788499B2 (en) Security tokens including displayable claims
CN109286633A (en) Single sign-on method, device, computer equipment and storage medium
CN107977905A (en) Matching process, device, medium and the electronic equipment of demand for services
US20040122774A1 (en) Method and system for executing applications on a mobile device
CN104468592B (en) Login method and login system
US9054884B2 (en) Proximity initiated co-browsing sessions
CN109408250A (en) Call application programming interface API approach, device, electronic equipment
CN106341234A (en) Authorization method and device
CN108028760A (en) For managing the technology of the certificate on computing device
CN110298162A (en) Application client login method, device, computer equipment and storage medium
CN107342966B (en) Authority credentials distribution method and device
CN112200575A (en) Node group creating method and node group-based transaction method in alliance chain network
CN109040024A (en) A kind of resource access right control method and system
US20090249430A1 (en) Claim category handling
CN107835181A (en) Right management method, device, medium and the electronic equipment of server cluster
CN107315646A (en) Data flow control method and device between page assembly
CN109753622A (en) static resource management method, device, storage medium and electronic equipment
CN110036387A (en) Integrated agreement system
WO2021026420A1 (en) Blockchain-based secure resource management

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
TR01 Transfer of patent right

Effective date of registration: 20210713

Address after: 200433 no.465 Guohe Road, Yangpu District, Shanghai

Patentee after: Shanghai suixun Electronic Technology Co.,Ltd.

Address before: 300000 Tianjin Binhai High-tech Zone Binhai Science Park, No. 39, No. 6 High-tech Road, 9-3-401

Patentee before: TIANJIN BYTEDANCE TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right