deps: Bump js-cookie to 3.0.0

pull/5163/head
Richard Hansen 2021-08-29 20:34:07 -04:00
parent ea43c92fe9
commit 7dbd278d1d
5 changed files with 21 additions and 20 deletions

View File

@ -2,7 +2,7 @@
"pad.js": [
"pad.js"
, "pad_utils.js"
, "$js-cookie/src/js.cookie.js"
, "$js-cookie/dist/js.cookie.js"
, "security.js"
, "$security.js"
, "vendors/browser.js"
@ -21,7 +21,7 @@
, "pad_connectionstatus.js"
, "chat.js"
, "vendors/gritter.js"
, "$js-cookie/src/js.cookie.js"
, "$js-cookie/dist/js.cookie.js"
, "$tinycon/tinycon.js"
, "vendors/farbtastic.js"
, "skin_variants.js"
@ -33,7 +33,7 @@
, "colorutils.js"
, "draggable.js"
, "pad_utils.js"
, "$js-cookie/src/js.cookie.js"
, "$js-cookie/dist/js.cookie.js"
, "vendors/browser.js"
, "pad_cookie.js"
, "pad_editor.js"
@ -73,7 +73,7 @@
, "scroll.js"
, "caretPosition.js"
, "pad_utils.js"
, "$js-cookie/src/js.cookie.js"
, "$js-cookie/dist/js.cookie.js"
, "security.js"
, "$security.js"
]

6
src/package-lock.json generated
View File

@ -3372,9 +3372,9 @@
}
},
"js-cookie": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-2.2.1.tgz",
"integrity": "sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ=="
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.0.tgz",
"integrity": "sha512-oUbbplKuH07/XX2YD2+Q+GMiPpnVXaRz8npE7suhBH9QEkJe2W7mQ6rwuMXHue3fpfcftQwzgyvGzIHyfCSngQ=="
},
"js-tokens": {
"version": "4.0.0",

View File

@ -45,7 +45,7 @@
"find-root": "1.1.0",
"formidable": "1.2.2",
"http-errors": "1.8.0",
"js-cookie": "^2.2.1",
"js-cookie": "^3.0.0",
"jsdom": "^16.7.0",
"jsonminify": "0.4.1",
"languages4translatewiki": "0.1.3",

View File

@ -383,7 +383,7 @@ const inThirdPartyIframe = () => {
// This file is included from Node so that it can reuse randomString, but Node doesn't have a global
// window object.
if (typeof window !== 'undefined') {
exports.Cookies = require('js-cookie/src/js.cookie');
exports.Cookies = require('js-cookie/dist/js.cookie').withAttributes({
// Use `SameSite=Lax`, unless Etherpad is embedded in an iframe from another site in which case
// use `SameSite=None`. For iframes from another site, only `None` has a chance of working
// because the cookies are third-party (not same-site). Many browsers/users block third-party
@ -392,8 +392,9 @@ if (typeof window !== 'undefined') {
//
// `Strict` is not used because it has few security benefits but significant usability drawbacks
// vs. `Lax`. See https://stackoverflow.com/q/41841880 for discussion.
exports.Cookies.defaults.sameSite = inThirdPartyIframe() ? 'None' : 'Lax';
exports.Cookies.defaults.secure = window.location.protocol === 'https:';
sameSite: inThirdPartyIframe() ? 'None' : 'Lax',
secure: window.location.protocol === 'https:',
});
}
exports.randomString = randomString;
exports.padutils = padutils;

View File

@ -18,7 +18,7 @@
<script src="../../static/js/vendors/jquery.js"></script>
<script src="lib/sendkeys.js"></script>
<script src="../../static/js/vendors/browser.js"></script>
<script src="../../static/plugins/js-cookie/src/js.cookie.js"></script>
<script src="../../static/plugins/js-cookie/dist/js.cookie.js"></script>
<script src="lib/underscore.js"></script>
<script src="lib/mocha.js"></script>