Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use BroadcastChannel first in default strategy #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.3 - 2021-07-16]

Minor release, bugfix

### Fixed

- Align default strategy with documentation. `BroadcastChannel` where available, `LocalStorage` as fallback.

## [1.0.0 - 2019-02-03]

Major release, entire plugin rewrite
Expand Down
2 changes: 1 addition & 1 deletion karma.conf.js
Expand Up @@ -124,7 +124,7 @@ module.exports = function karmaConfig(config) {
customLaunchers,
browsers: browserStack.username
? Object.keys(customLaunchers)
: ["HeadlessChrome"],
: ["ChromeHeadless"],
customHeaders: [
{
match: ".*\\.html",
Expand Down
8 changes: 4 additions & 4 deletions src/strategies/defaultStrategy.js
Expand Up @@ -3,13 +3,13 @@ import LocalStorageStrategy from "./localStorage";

export default function createDefaultStrategy() {
/* istanbul ignore next: browser-dependent code */
if (LocalStorageStrategy.available()) {
return new LocalStorageStrategy();
if (BroadcastChannelStrategy.available()) {
return new BroadcastChannelStrategy();
}

/* istanbul ignore next: browser-dependent code */
if (BroadcastChannelStrategy.available()) {
return new BroadcastChannelStrategy();
if (LocalStorageStrategy.available()) {
return new LocalStorageStrategy();
}

/* istanbul ignore next: browser-dependent code */
Expand Down