-
Update (sub-)dependencies
- axios to 1.7.7
- body-parse to 1.20.3
- cookie to 0.7.1
- elliptic to 6.6.1
- micromatch to 4.0.8
- send to 0.19.0
- serve-static to 1.16.2
-
Update dev dependencies:
- chromedriver to v131.0.1
- express to 4.20.1
- Update @braintree/uuid to v1.0.0
- Update dev dependencies:
- chromedriver to v125.0.3
- ejs to v3.1.10
- express to v4.19.2
- gulp to v5.0.0
- Update package-lock file version from 1 to 3
- Minor dev dependency updates
-
Update to node v18
-
Dev Dependency Updates
- Update to TypeScript 5
- Update Chromedriver to 118
- Fix circular dependency issue (Issue #97)
- Add ability to target specific frames with
targetFramesconfiguration - Add
addTargetFramemethod to add additional frames totargetFrames
- Fix issue where framebus could not be used with server side rendering
- Fix issue where Internet Explorer would error because Promise is not defined
- Fix issue where emitting to new window could cause an infinite loop (closes #41, thanks @blutorange)
- Add
emitAsPromiseas convenience method when waiting for replies fromemitcalls - Add
setPromisestatic method for easy polyfilling environments that do not support promises
-
Allow scoping to a specific channel for events
var bus = new Framebus({ channel: "some-unique-identifier-used-on-both-the-parent-and-child-pages", });
-
Add
verifyDomainconfig to scope messages to specific domainsvar bus = new Framebus({ verifyDomain: function (url) { // only listens for events emitted from `https://parent-url.example.com` and `https://my-domain.example.com` return url.indexOf("https://my-domain.example.com"); }, });
-
Add
teardownmethod for easy cleanup
Breaking Changes
-
Instantiate new instances of framebus
// v4 var bus = require("framebus"); bus.on(/* args */); bus.emit(/* args */); // v5 var Framebus = require("framebus"); var bus = new Framebus(); bus.on(/* args */); bus.emit(/* args */);
-
Instantiating a framebus with
targetmethod with anoriginparam now requires an options object (same object that is used to instantiate the instance)// v4 var bus = require("framebus"); var anotherBus = bus.target("example.com"); // v5 var Framebus = require("framebus"); var bus = Framebus.target({ origin: "example.com", }); var anotherBus = bus.target({ origin: "example.com", });
- Fixup Framebus typing for Typescript integrations
- Use
@braintree/uuidpackage for uuid generation - Update typescript to v4
- Fix issue where rollup bundlers could not import framebus (see braintree-web#504)
- Fix issue where framebus could not be used with server side rendering
Breaking Changes
- Drop support for IE < 9
- Drop support for using methods standalone without using the bus
- Drop
publish,pub, andtriggermethods. Useemit - Drop
subscribeandsubmethods. Useon - Drop
unsubscribeandunsubmethods. Useoff - Drop support for passing multiple arguments to
emit, not it only supports passingdataandreply
-
Fix issue where framebus would error when trying to reply to a non-existent window/frame
-
Fix issue where broadcasts to frames would fail if parent page has overwritten the window.length variable
BREAKING CHANGES
-
Module is now CommonJS only, and must be used with npm with a build tool (Browserify, Webpack, etc)
-
Bower support dropped
-
Fall back to
window.selfwhenwindow.topis undefined in old versions of IE. -
Corrects a regression introduced in 2.0.6 that prevented CommonJS runtimes from working.
-
framebus can be required (but not executed) from Node.js® environments.
-
Only traverse to
openerfrom the top-level frame -
Avoid exceptions while broadcasting events
-
Do not infinitely recurse when
window.opener === window
[unpublished]
-
Do not throw exceptions
window.openerexisted but has already closed. -
Do not throw exceptions when a
frame.postMessageis denied. -
Exceptions are no longer thrown when
publish,subscribeorunsubscribewere invoked directly.var publish = framebus.publish; publish("event");
-
Breaking change: use of
originas a parameter forpublish,subscribeandunsubscribehas been moved to the chaining-functiontarget(origin) -
Added feature: events can be published with multiple arguments. If the last argument is a function, it is treated as a callback that subscribers can call.
-
Added feature:
include(popup)adds popups to the listing of frames to be messaged. -
Added feature:
window.openerwill now be included in framebus messaging, if available. -
Initial release