Commit 654ca3ed authored by Christof Dorner's avatar Christof Dorner

Merge pull request #3385 from hypothesis/gh2723-fix-client-on-pages-that-define-global

Fix client on pages that define a variable called `global`
parents bd999996 f732879a
...@@ -86,7 +86,18 @@ module.exports = function createBundle(config, buildOpts) { ...@@ -86,7 +86,18 @@ module.exports = function createBundle(config, buildOpts) {
'querystring', 'querystring',
], ],
insertGlobalVars: { insertGlobalVars: {
// The Browserify polyfill for the `Buffer` global is large and
// unnecessary, but can get pulled into the bundle by modules that can
// optionally use it if present.
Buffer: undefined, Buffer: undefined,
// Override the default stub for the `global` var which defaults to
// the `global`, `self` and `window` globals in that order.
//
// This can break on web pages which provide their own definition of
// `global`. See https://github.com/hypothesis/h/issues/2723
global: function () {
return 'typeof self !== "undefined" ? self : window';
},
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment