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

postis

Package Overview
Dependencies
Maintainers
4
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postis - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # Change Log

## [2.2.0] - 2016-02-01
### Added
- Adds destroy method to Postis channel
## [2.1.1] - 2016-01-28
### Fixed
- Check that targetWindow has postMessage property on send
## [2.1.0] - 2016-01-20

@@ -7,0 +15,0 @@ ### Added

2

package.json
{
"name": "postis",
"version": "2.1.0",
"version": "2.2.0",
"description": "Lightweight wrapper around the PostMessage API",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -60,1 +60,14 @@ # Postis

```
## Release
New releases are prepared in master after merging the PRs. Please include a meaningful changelog entry in PR.
Write a new `CHANGELOG.md` entry before running built-in [npm version](https://docs.npmjs.com/cli/version) bump and add the change to next commit.
```
npm version <major | minor | patch>
git push --tags
```
`npm version` should include added changelog entry in the commit. Remember to push changes.

@@ -10,6 +10,8 @@ function Postis(options) {

var readyMethod = "__ready__";
var readynessCheck;
windowForEventListening.addEventListener("message", function (event) {
var listener = function(event) {
var data;
try {
var data = JSON.parse(event.data);
data = JSON.parse(event.data);
} catch (e) {

@@ -30,4 +32,6 @@ return;

}
}, false);
};
windowForEventListening.addEventListener("message", listener, false);
var postis = {

@@ -53,3 +57,3 @@ listen: function (method, callback) {

if (ready || opts.method === readyMethod) {
if ((ready || opts.method === readyMethod) && (targetWindow && typeof targetWindow.postMessage === "function")) {
targetWindow.postMessage(JSON.stringify({

@@ -72,2 +76,11 @@ postis: true,

}
},
destroy: function (callback) {
clearInterval(readynessCheck);
ready = false;
if (windowForEventListening && typeof windowForEventListening.removeEventListener === "function") {
windowForEventListening.removeEventListener("message", listener);
}
callback && callback();
}

@@ -78,3 +91,3 @@ };

var readynessCheck = setInterval(function () {
readynessCheck = setInterval(function () {
postis.send({

@@ -81,0 +94,0 @@ method: readyMethod,

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