-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from litetex/develop
Release 1.0.0
- Loading branch information
Showing
20 changed files
with
6,862 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Develop CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ develop ] | ||
pull_request: | ||
branches: [ develop ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm install | ||
working-directory: src | ||
|
||
- run: npm run web-ext lint | ||
working-directory: src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Master CI | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- run: npm install | ||
working-directory: src | ||
|
||
- run: npm run web-ext lint | ||
working-directory: src | ||
|
||
- run: npm run web-ext build | ||
working-directory: src | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: built-artifacts | ||
path: src/web-ext-artifacts/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web-ext-artifacts/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,36 @@ | ||
# predefined-cookie-loader | ||
Loads, overrides and sets predefined cookies into your browser | ||
[![build](https://img.shields.io/github/workflow/status/litetex/predefined-cookie-loader/Master%20CI?label=build)](https://github.com/litetex/predefined-cookie-loader/actions?query=workflow%3A%22Master+CI%22) | ||
[![build develop](https://img.shields.io/github/workflow/status/litetex/predefined-cookie-loader/Develop%20CI?label=build%20develop)](https://github.com/litetex/predefined-cookie-loader/actions?query=workflow%3A%22Develop+CI%22) | ||
# predefined-cookie-loader <img src="src/icons/icon96.png" width=56></img> | ||
|
||
Loads, overrides and sets predefined 🍪 cookies into the browser | ||
|
||
## Install | ||
Install as [Firefox-Addon]() | ||
|
||
## Use cases | ||
### Private browsing | ||
Your browser automatically deletes everything after you closed it? <br/> | ||
<img src="assets/DeleteBrowsingDataOnClose.png" height=40></img> | ||
|
||
And when you start it again everything is full of "We use cookies"-popups?<br/> | ||
<img src="assets/CookiePopupExample.png" height=264></img> | ||
|
||
Now you can preload the corresponding cookies: | ||
```JSON | ||
{ | ||
"<wellknownSearchEngine>.com": [ | ||
{ | ||
"name": "CONSENT", | ||
"value": "YES+undefined.undefined+V14+undefined", | ||
"secure": true | ||
} | ||
], | ||
"<wellknownVideoPlatform>.com": [ | ||
{ | ||
"name": "CONSENT", | ||
"value": "YES+undefined.undefined+V14+undefined", | ||
"secure": true | ||
} | ||
] | ||
} | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"extensionName" : { | ||
"message": "Predefined Cookie Loader", | ||
"description": "Name of the extension" | ||
}, | ||
"extensionNameShort" : { | ||
"message": "PreCookieLoader", | ||
"description": "Short name of the extension" | ||
}, | ||
"extensionDescription" : { | ||
"message": "Loads, overrides and sets predefined cookies", | ||
"description": "Description of the extension" | ||
}, | ||
"browserAction_settings" : { | ||
"message": "Settings", | ||
"description": "Opens the settings page" | ||
}, | ||
"settings" : { | ||
"message": "Settings", | ||
"description": "settings" | ||
}, | ||
"save" : { | ||
"message": "Save", | ||
"description": "save" | ||
}, | ||
"cookies_for_preload": { | ||
"message": "Cookies for preload", | ||
"description": "Cookies for preload" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"use strict"; | ||
|
||
function loadDefaultCookies() { | ||
chrome.storage.local.get({ | ||
preLoadCookies: new Map() | ||
}, function (data) { | ||
|
||
try { | ||
if (!data.preLoadCookies || !(data.preLoadCookies instanceof Map)) { | ||
return; | ||
} | ||
|
||
data.preLoadCookies.forEach(function (value, key, map) { | ||
let origin = "https://" + key; | ||
|
||
console.log("Processing: '" + origin + "'"); | ||
|
||
value.forEach(cookie => { | ||
|
||
let cookieToSet = Object.assign({ url: origin }, cookie); | ||
if (!cookieToSet.domain) { | ||
cookieToSet.domain = "." + key; | ||
} | ||
|
||
console.log(cookieToSet); | ||
|
||
chrome.cookies.set(cookieToSet); | ||
}); | ||
}); | ||
|
||
} catch (e) { | ||
console.error(e); | ||
} | ||
}); | ||
} | ||
|
||
chrome.runtime.onStartup.addListener(loadDefaultCookies); | ||
chrome.runtime.onMessage.addListener(loadDefaultCookies); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
body { | ||
padding: 0.5em; | ||
margin: 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<link href="browserAction.css" rel="stylesheet" type="text/css"> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
</head> | ||
<body> | ||
<div id="actions"></div> | ||
<script src="browserAction.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"use strict"; | ||
|
||
document.title = chrome.i18n.getMessage("extensionName") + " Menu"; | ||
|
||
function buildActions() { | ||
const actions = document.getElementById('actions'); | ||
[ | ||
{ | ||
label: "settings", | ||
action: function () { | ||
if (chrome.runtime && chrome.runtime.openOptionsPage) { | ||
chrome.runtime.openOptionsPage(); | ||
} | ||
else { | ||
window.open(chrome.extension.getURL("options/options.html"), "_blank"); | ||
} | ||
} | ||
} | ||
].forEach(function (action) { | ||
const btnAction = document.createElement("button"); | ||
btnAction.className = "action"; | ||
|
||
btnAction.appendChild( | ||
document.createTextNode( | ||
browser.i18n.getMessage("browserAction_" + action.label) || action.label | ||
) | ||
); | ||
btnAction.addEventListener("click", action.action); | ||
actions.appendChild(btnAction); | ||
}); | ||
} | ||
|
||
buildActions(); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "__MSG_extensionName__", | ||
"description": "__MSG_extensionDescription__", | ||
"version": "1.0.0", | ||
"homepage_url": "https://github.com/litetex/predefined-cookie-loader", | ||
"author": "litetex", | ||
"icons": { | ||
"48": "icons/icon48.png", | ||
"96": "icons/icon96.png" | ||
}, | ||
"browser_action": { | ||
"browser_style": true, | ||
"default_title": "__MSG_extensionNameShort__", | ||
"default_popup": "browserAction/browserAction.html" | ||
}, | ||
"options_ui": { | ||
"open_in_tab": true, | ||
"page": "options/options.html" | ||
}, | ||
"permissions": [ | ||
"http://*/*", | ||
"https://*/*", | ||
"cookies", | ||
"storage" | ||
], | ||
"background": { | ||
"scripts": [ | ||
"background/scripts/cookieloader.js" | ||
] | ||
}, | ||
"default_locale": "en", | ||
"manifest_version": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
html, body { | ||
margin: 0; | ||
min-width: 100%; | ||
height: 100%; | ||
} | ||
|
||
h2 { | ||
margin: 0; | ||
margin-top: 0.5em; | ||
margin-bottom: 0.25em; | ||
} | ||
|
||
h4 { | ||
margin: 0; | ||
margin-top: 0.3em; | ||
margin-bottom: 0.15em; | ||
} | ||
|
||
#options { | ||
padding: 1em; | ||
align-items: flex-start; | ||
} | ||
|
||
#cookiesForPreload { | ||
align-self: stretch; | ||
} | ||
|
||
#save { | ||
font-size: large; | ||
} | ||
|
||
#save-block { | ||
align-items: baseline; | ||
} | ||
|
||
.save-failed { | ||
color: darkred; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<html> | ||
<head> | ||
<link href="../styles/shared.css" rel="stylesheet" type="text/css"> | ||
<link href="options.css" rel="stylesheet" type="text/css"> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
</head> | ||
<body class="flex-container-v"> | ||
<div id="options" class="flex-container-v flex-child-autogrow"> | ||
|
||
<h2 id="title"></h2> | ||
|
||
<h4 id="cookiesForPreloadHeader"></h4> | ||
<textarea id="cookiesForPreload" class="flex-child-autogrow" spellcheck="false"></textarea> | ||
|
||
<div id="save-block" class="flex-container flex-child-contentsize"> | ||
<input type="button" id="save" class="flex-child-contentsize"/> | ||
<span id="save-result" ></span> | ||
</div> | ||
</div> | ||
|
||
<script src="options.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.