Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ember-window-messenger

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-window-messenger - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

3

addon/services/client.js

@@ -5,4 +5,3 @@ import Ember from 'ember';

const { run } = Ember;
const { aliasMethod } = Ember;
const { run, aliasMethod } = Ember;

@@ -9,0 +8,0 @@ export default Ember.Service.extend(BaseServiceMixin, {

@@ -0,3 +1,8 @@

## v0.1.1
* Refactoring
* Add unit tests for server: resolve, reject, query scenarios
## v0.1.0
An initial release of this addon.
{
"name": "ember-window-messenger",
"version": "0.1.0",
"version": "0.1.1",
"description": "Simple window postMessage Ember addon",

@@ -14,3 +14,6 @@ "directories": {

},
"repository": "",
"repository": {
"type": "git",
"url": "https://github.com/raido/ember-window-messenger"
},
"engines": {

@@ -44,3 +47,5 @@ "node": ">= 0.10.0"

"keywords": [
"ember-addon"
"ember-addon",
"postMessage",
"communication"
],

@@ -47,0 +52,0 @@ "dependencies": {

@@ -9,3 +9,3 @@ # ember-window-messenger

For changelog see [CHANGES.md](CHANGES.md)
For changelog see [CHANGES.md](https://github.com/raido/ember-window-messenger/blob/master/CHANGES.md)

@@ -18,5 +18,24 @@ **It supports JSON only messages for now**

#### Configuration
Add `target:origin` map to your `config/environment.js`. This effectively defines which targets (windows, frames) is your app communicating with.
```javascript
APP: {
// Here you can pass flags/options to your application instance
// when it is created
'ember-window-messenger': {
'parent': 'http://localhost:4200',
'target-1': 'http://localhost:4200',
'target-2': 'http://localhost:4200',
'popup': 'http://localhost:4200'
}
}
```
This list is also used for validation, to check if message comes from an allowed origin.
### Examples
If dare, fire up the dummy app in this addon and test it out. Below are the basic examples, see dummy app for more.
If you dare, fire up the dummy app in this addon and test it out. Below are the basic examples, see dummy app for more.

@@ -31,3 +50,5 @@ #### Setup server on parent

beforeModel() {
init() {
this._super.apply(...arguments);
server.on('demo-data' (resolve, reject, query) => {

@@ -54,2 +75,18 @@ resolve('Some data');

#### Fetch from a specific target
This can be used from parent window to frames/tabs communication.
```javascript
import Ember from 'ember';
export default Ember.Route.extend({
client: Ember.inject.service('window-messenger-client'),
model() {
return this.get('client').fetch('popup:demo-data');
}
});
```
#### Execute RPC call

@@ -56,0 +93,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc