You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
708 B
24 lines
708 B
6 years ago
|
const TOKEN = 'cd792dcdf21d1c0afb84ef101bfcde35f5f7d9fa';
|
||
|
const DOMAIN = '.gog.com';
|
||
|
const PATH = '/';
|
||
|
const EXPIRATION = 2147483647.0;
|
||
|
const COOKIES = ['pp', 'pp_st'];
|
||
|
|
||
|
chrome.runtime.onMessage.addListener(
|
||
|
function(request, sender, sendResponse) {
|
||
|
if (request.message === 'set_gog_cookies') {
|
||
|
COOKIES.forEach(function(name) {
|
||
|
let cookie = {
|
||
|
url: 'https://*.gog.com',
|
||
|
name: name,
|
||
|
value: TOKEN,
|
||
|
domain: DOMAIN,
|
||
|
path: PATH,
|
||
|
expirationDate: EXPIRATION
|
||
|
};
|
||
|
chrome.cookies.set(cookie);
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
);
|