Skip to content

browser polyfills : use window or self for the global polyfill #586

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions plugins/css-blank-pseudo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to CSS Blank Pseudo

### Unreleased

- Fix: assign global browser polyfill to `window`, `self` or a blank object.

### 4.1.0 (July 30, 2022)

- Added: `disablePolyfillReadyClass` plugin option to prevent `.js-blank-pseudo` from being added.
Expand Down
7 changes: 5 additions & 2 deletions plugins/css-blank-pseudo/src/browser-global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* global self */
/* global self,window */
import { default as cssBlankPseudoInit } from './browser';
self.cssBlankPseudoInit = cssBlankPseudoInit;

(function (global) {
global.cssBlankPseudoInit = cssBlankPseudoInit;
}('object' === typeof window && window || 'object' === typeof self && self || {}));
4 changes: 4 additions & 0 deletions plugins/css-has-pseudo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to CSS Has Pseudo

### Unreleased

- Fix: assign global browser polyfill to `window`, `self` or a blank object.

### 4.0.0 (July 8, 2022)

[Read the full changelog](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-8)
Expand Down
7 changes: 5 additions & 2 deletions plugins/css-has-pseudo/src/browser-global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* global self */
/* global self,window */
import { default as cssHasPseudo } from './browser';
self.cssHasPseudo = cssHasPseudo;

(function (global) {
global.cssHasPseudo = cssHasPseudo;
}('object' === typeof window && window || 'object' === typeof self && self || {}));
4 changes: 4 additions & 0 deletions plugins/css-prefers-color-scheme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to Prefers Color Scheme

### Unreleased

- Fix: assign global browser polyfill to `window`, `self` or a blank object.

### 7.0.0 (July 8, 2022)

[Read the full changelog](https://github.com/csstools/postcss-plugins/wiki/PostCSS-Preset-Env-8)
Expand Down
7 changes: 5 additions & 2 deletions plugins/css-prefers-color-scheme/src/browser-global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* global self */
/* global self,window */
import { default as prefersColorSchemeInit } from './browser';
self.prefersColorSchemeInit = prefersColorSchemeInit;

(function (global) {
global.prefersColorSchemeInit = prefersColorSchemeInit;
}('object' === typeof window && window || 'object' === typeof self && self || {}));
4 changes: 4 additions & 0 deletions plugins/postcss-focus-within/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changes to PostCSS Focus Within

### Unreleased

- Fix: assign global browser polyfill to `window`, `self` or a blank object.

### 6.1.0 (July 30, 2022)

- Added: `disablePolyfillReadyClass` plugin option to prevent `.js-focus-within` from being added.
Expand Down
7 changes: 5 additions & 2 deletions plugins/postcss-focus-within/src/browser-global.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/* global self */
/* global self,window */
import { default as focusWithinInit } from './browser';
self.focusWithinInit = focusWithinInit;

(function (global) {
global.focusWithinInit = focusWithinInit;
}('object' === typeof window && window || 'object' === typeof self && self || {}));