Skip to content

Commit b3860f3

Browse files
authored
Merge pull request #77 from SpringRoll/chore/prep-for-release
Chore/prep for release
2 parents 9027182 + 677b618 commit b3860f3

File tree

7 files changed

+21
-9
lines changed

7 files changed

+21
-9
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ container.openPath('local/path/to/game.html');
4242
### Opening a Game Hosted at Another Domain
4343

4444
```javascript
45-
const container = new Container({
46-
iframeSelector: '#game'
47-
});
45+
const container = new Container('#game');
4846

4947
container.openLocal('https://example.com/path/to/game.html');
5048
```
@@ -72,6 +70,20 @@ const container = new Container('#game', {
7270
container.openPath('path/to/game.html');
7371
```
7472

73+
### Opening a Game with a Dynamically Created Iframe
74+
In some cases, you may have an existing [HTMLIframeElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement) rather than a CSS selector.
75+
You can also instantiate a container from the DOM element as well:
76+
77+
```javascript
78+
import { Container } from 'springroll-container';
79+
80+
const iframe = document.createElement('iframe');
81+
document.body.appendChild(iframe);
82+
83+
const container = new Container(iframe);
84+
container.openPath('/path/to/game.html');
85+
```
86+
7587
## Plugins
7688
This section provides instructions on how to use the built-in plugins for SpringRoll Container. For writing or updating older plugins, see the [Plugin Authoring Guide](https://github.com/SpringRoll/SpringRollContainer/tree/main/src/plugins).
7789

dist/SpringRoll-Container-umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-Container-umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "springroll-container",
3-
"version": "2.0.3",
3+
"version": "2.1.0",
44
"description": "The iframe controller for interacting with SpringRoll applications",
55
"main": "./dist/index.js",
66
"license": "MIT",

0 commit comments

Comments
 (0)