IP Library Granted Patent US 11,171,993
Granted Patent B2
US 11,171,993 · App. 16/726,415 · Granted Nov 9, 2021

Cross-origin communication in restricted computer environments

Inventor: Matthew Steven Frisbie (Redwood City, CA)
Assignee: Google LLC
H04L63/20G06F21/53G06F21/6209H04L63/10H04L67/34G06F2221/2119
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,171,993
App. No.
16/726,415
Granted
Nov 9, 2021
Kind
B2
Abstract

This specification discloses techniques for communicating data between a first execution context on a computing system and a second execution context on the computing system. The first execution context can execute content from a first origin, the second execution context can execute content from a second origin that is different from the first origin, and the first execution context and the second execution context can each be restricted from accessing data of the other as a result of a same-origin policy implemented by the computing system. The method can include establishing a bi-directional communication channel between the first execution context and the second execution context.

Claims (79)

1. A computer-implemented method for communicating data between a first execution context on a computing system and a second execution context on the computing system,

wherein the first execution context executes content from a first origin,

wherein the second execution context executes content from a second origin that is different from the first origin, and

wherein the computing system implements a security policy that restricts particular interactions between the first execution context and the second execution context, the method comprising:

exchanging a first set of messages between the first execution context and the second execution context to establish a bi-directional communication channel between the first execution context and the second execution context, wherein the first set of messages are not restricted by the security policy;

after establishing the bi-directional communication channel:

restricting use of the bi-directional communication channel by a first service within the first execution context or a second service within the second execution context;

validating the bi-directional communication channel, the validating comprising:

transmitting, from the second execution context and to the first execution context, a first channel connection message that instructs the first execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the first service within the first execution context is removed; and

transmitting, from the first execution context and to the second execution context, a second channel connection message that instructs the second execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the second service within the second execution context is removed; and

in response to validating the bi-directional communication channel, ceasing to restrict use of the bi-directional communication channel by the first service within the first execution context or the second service within the second execution context.

2. The computer-implemented method of claim 1 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel comprises:

receiving, in the first execution context, an initial discovery message that was transmitted from the second execution context; and

determining, in the first execution context and based on the initial discovery message that was transmitted from the second execution context, an identifier of the second execution context.

3. The computer-implemented method of claim 2 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel further comprises establishing, using the identifier of the second execution context, a first uni-directional sub-channel of the bi-directional communication channel, the first uni-directional sub-channel configured to carry messages from the first execution context to the second execution context.

4. The computer-implemented method of claim 3 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel further comprises:

receiving, in the second execution context, a connection broadcast message that was transmitted from the first execution context over the first uni-directional sub-channel;

determining, in the second execution context and based on the connection broadcast message that was transmitted from the first execution context over the first uni-directional sub-channel, an identifier of the first execution context; and

establishing, using the identifier of the first execution context, a second uni-directional sub-channel of the bi-directional communication channel, the second uni-directional sub-channel configured to carry messages from the second execution context to the first execution context.

5. The computer-implemented method of claim 4 , further comprising:

generating the first execution context and the second execution context with a web browsing application of the computing system,

wherein the first uni-directional sub-channel is configured to carry messages from the first execution context to the second execution context using a postMessage application programming interface (API) of the web browsing application,

wherein the second uni-directional sub-channel is configured to carry messages from the second execution context to the first execution context using the postMessage API of the web browsing application.

6. The computer-implemented method of claim 1 , wherein the first execution context comprises a first window object configured to present the content from the first origin, wherein the second execution context comprises a second window object configured to present the content from the second origin.

7. The computer-implemented method of claim 6 , wherein:

the content presented in the first window object comprises a first web page that is hosted by one or more servers at a first domain associated with the first origin;

the content presented in the second window object comprises a second web page that is hosted by one or more servers at a second domain associated with the second origin; and

the second window object is an inline frame (iFrame) that is embedded in the first web page.

8. The computer-implemented method of claim 1 , wherein the second execution context is a descendant of the first execution context in a hierarchy of execution contexts on the computing system.

9. The computer-implemented method of claim 1 , further comprising:

setting a listener in the first execution context for the first channel connection message; and

when the listener detects receipt of the first channel connection message, removing the restriction on use of the bi-directional communication channel by the first service within the first execution context.

10. One or more non-transitory computer-readable media having instructions stored thereon that, when executed by one or more processors of a computing system, cause the one or more processors to perform operations for communicating data between a first execution context on the computing system and a second execution context on the computing system,

wherein the first execution context executes content from a first origin,

wherein the second execution context executes content from a second origin that is different from the first origin,

wherein the computing system implements a security policy that restricts particular interactions between the first execution context and the second execution context, and

wherein the operations comprise:

exchanging a first set of messages between the first execution context and the second execution context to establish a bi-directional communication channel between the first execution context and the second execution context, wherein the first set of messages are not restricted by the security policy;

after establishing the bi-directional communication channel:

restricting use of the bi-directional communication channel by a first service within the first execution context or a second service within the second execution context;

validating the bi-directional communication channel, the validating comprising:

transmitting, from the second execution context and to the first execution context, a first channel connection message that instructs the first execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the first service within the first execution context is removed; and

transmitting, from the first execution context and to the second execution context, a second channel connection message that instructs the second execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the second service within the second execution context is removed; and

in response to validating the bi-directional communication channel, ceasing to restrict use of the bi-directional communication channel by the first service within the first execution context or the second service within the second execution context.

11. The one or more non-transitory computer-readable media of claim 10 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel comprises:

receiving, in the first execution context, an initial discovery message that was transmitted from the second execution context; and

determining, in the first execution context and based on the initial discovery message that was transmitted from the second execution context, an identifier of the second execution context.

12. The one or more non-transitory computer-readable media of claim 11 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel further comprises establishing, using the identifier of the second execution context, a first uni-directional sub-channel of the bi-directional communication channel, the first uni-directional sub-channel configured to carry messages from the first execution context to the second execution context.

13. The one or more non-transitory computer-readable media of claim 12 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel further comprises:

receiving, in the second execution context, a connection broadcast message that was transmitted from the first execution context over the first uni-directional sub-channel;

determining, in the second execution context and based on the connection broadcast message that was transmitted from the first execution context over the first uni-directional sub-channel, an identifier of the first execution context; and

establishing, using the identifier of the first execution context, a second uni-directional sub-channel of the bi-directional communication channel, the second uni-directional sub-channel configured to carry messages from the second execution context to the first execution context.

14. The one or more non-transitory computer-readable media of claim 13 , wherein the operations further comprise:

generating the first execution context and the second execution context with a web browsing application of the computing system,

wherein the first uni-directional sub-channel is configured to carry messages from the first execution context to the second execution context using a postMessage application programming interface (API) of the web browsing application,

wherein the second uni-directional sub-channel is configured to carry messages from the second execution context to the first execution context using the postMessage API of the web browsing application.

15. The one or more non-transitory computer-readable media of claim 10 , wherein the first execution context comprises a first window object configured to present the content from the first origin, wherein the second execution context comprises a second window object configured to present the content from the second origin.

16. The one or more non-transitory computer-readable media of claim 15 , wherein:

the content presented in the first window object comprises a first web page that is hosted by one or more servers at a first domain associated with the first origin;

the content presented in the second window object comprises a second web page that is hosted by one or more servers at a second domain associated with the second origin; and

the second window object is an inline frame (iFrame) that is embedded in the first web page.

17. The one or more non-transitory computer-readable media of claim 10 , wherein the second execution context is a descendant of the first execution context in a hierarchy of execution contexts on the computing system.

18. The one or more non-transitory computer-readable media of claim 10 , wherein the operations further comprise:

setting a listener in the first execution context for the first channel connection message; and

when the listener detects receipt of the first channel connection message, removing the restriction on use of the bi-directional communication channel by the first service within the first execution context.

19. A computing system comprising one or more processors and one or more non-transitory computer-readable media encoded with instructions that, when executed, cause the one or more processors to implement:

a first execution context that executes content from a first origin; and

a second execution context that executes content from a second origin that is different from the first origin, wherein the computing system implements a security policy that restricts particular interactions between the first execution context and the second execution context;

wherein the first execution context and the second execution context are configured to establish and use a bi-directional communication channel by performing operations that comprise:

exchanging a first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel between the first execution context and the second execution context, wherein the first set of messages are not restricted by the security policy;

after establishing the bi-directional communication channel:

restricting use of the bi-directional communication channel by a first service within the first execution context or a second service within the second execution context;

validating the bi-directional communication channel, the validating comprising:

 transmitting, from the second execution context and to the first execution context, a first channel connection message that instructs the first execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the first service within the first execution context is removed; and

 transmitting, from the first execution context and to the second execution context, a second channel connection message that instructs the second execution context to set the bi-directional communication channel to a connected state in which a restriction on use of the bi-directional communication channel by the second service within the second execution context is removed; and

in response to validating the bi-directional communication channel, ceasing to restrict use of the bi-directional communication channel by the first service within the first execution context or the second service within the second execution context.

20. The computing system of claim 19 , wherein exchanging the first set of messages between the first execution context and the second execution context to establish the bi-directional communication channel comprises:

receiving, in the first execution context, an initial discovery message that was transmitted from the second execution context; and

determining, in the first execution context and based on the initial discovery message that was transmitted from the second execution context, an identifier of the second execution context.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 13, 2020
From: FRISBIE, MATTHEW STEVEN
To: GOOGLE INC.
Reel/Frame 052109/0128 →
CHANGE OF NAME Recorded Mar 13, 2020
From: GOOGLE INC.
To: GOOGLE LLC
Reel/Frame 052164/0678 →
Continuity (2)
Continuation 15624921 · Jun 16, 2017
Related Publication 20200137120A1 · Apr 30, 2020