Remotable Contracts for Web Iframe Type Safety

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional postMessage method between iframes is limited to passing unstructured text strings, lacks object identity, and is dynamically typed, leading to runtime errors and restricted control flow patterns, such as asynchronous methods and events, due to security restrictions across different domains.

Innovation Solution

The Remotable Contract Implementation annotates and translates structured code or control flow into text messages that can be passed across postMessage channels, enabling static type-checking and rich control flow interactions between iframes using statically typed proxies and dynamic reflection, allowing for the transmission of structured data and executable code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the postMessage method is used to communicate between iframes from different domains, then security is maintained through domain restriction, but the ability to pass structured data and executable code is lost

Engineering Contradiction:
ImprovesecurityVSAvoidstructured data transmission capability
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent introduces a mediator layer that translates structured data and executable code into text string representations for transmission via postMessage, then reconstructs them at the receiving end. This intermediary translation mechanism allows complex data types to pass through the restricted channel while maintaining security boundaries.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The invention changes the parameter format of data being transmitted by converting structured objects and code into serialized text strings that conform to postMessage constraints, while preserving the ability to reconstruct the original data structure and functionality at the destination.

Inventive Principle:
Principle #35Parameter changes

2Reliability

If only text strings are passed between iframes using postMessage, then security restrictions are satisfied, but object identity and structured field access are lost

Engineering Contradiction:
Improvesecurity restriction complianceVSAvoidobject identity
Core Design Contradiction:
ReliabilityVSLoss of information

Solution Approach 1:

The patent creates a copy mechanism where objects are serialized into text representations that include identity information, transmitted via postMessage, then deserialized into proxy objects that maintain references to the original objects. This copying approach preserves object identity across the security boundary while satisfying text-only transmission constraints.

Inventive Principle:
Principle #26Copying

3Ease of manufacture

If dynamic typing is used in postMessage communication, then ease of implementation is maintained, but runtime errors cannot be prevented

Engineering Contradiction:
Improveimplementation simplicityVSAvoiderror prevention
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent implements preliminary type checking and validation during the serialization and deserialization processes, before data is transmitted and executed. This preliminary action catches type errors early in the process rather than allowing them to manifest as runtime errors during execution, while still maintaining the dynamic typing framework.

Inventive Principle:
Principle #10Preliminary action

4Adaptability or versatility

If conventional postMessage is used for communication, then browser compatibility is maintained, but rich control flow patterns like asynchronous methods and events are not available

Engineering Contradiction:
Improvebrowser compatibilityVSAvoidcontrol flow pattern availability
Core Design Contradiction:
Adaptability or versatilityVSEase of operation

Solution Approach 1:

The patent substitutes the limited mechanical postMessage text transmission with a more sophisticated system that uses serialization, deserialization, and proxy creation to enable advanced control flow patterns. This replacement maintains compatibility with the existing postMessage mechanism while adding capabilities for asynchronous methods, events, and other rich control flow patterns through the translation layer.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Data Source

PatentUS9569292B2Remotable contracts for the web
Publication Date: 2017.02.14 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9569292B2 patent drawing
  • US9569292B2 patent drawing
  • US9569292B2 patent drawing

AI summary

A “Remotable Contract Implementation”, as described herein, provides various techniques for implementing static type checking of remoted contracts across iframes using scripts such as TypeScript, JavaScript, AJAX, etc., thereby enabling structured data and rich patterns of control flow across iframe boundaries. The Remotable Contract Implementation enables the static type-checking over the limited browser postMessage channel of communication across iframes, by generating statically type-checked proxies at runtime based on dynamic reflection, and allowing for full fidelity of JavaScript control flow interactions (e.g. methods, events, asynchronous communications, etc.) over that channel. Further, in various embodiments, the Remotable Contract Implementation provides various methods that can be used to produce useful application context for otherwise isolated applications by providing access to particular browser resources or information that would otherwise be unavailable over the postMessage communication channel using conventional scripting techniques.