Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4d7c7a0
Update translations.
zoracon May 6, 2019
569e802
Update translations.
zoracon May 6, 2019
a52f5bf
Merge branch 'master' of github.com:EFForg/https-everywhere
zoracon May 9, 2019
f900938
Update translations.
zoracon May 13, 2019
483302f
Merge branch 'master' of github.com:EFForg/https-everywhere
zoracon Aug 26, 2019
b303902
Merge branch 'master' of github.com:EFForg/https-everywhere
zoracon Aug 30, 2019
8abb2e1
Create pull_request_template.md
zoracon Sep 5, 2019
342a077
Update pull_request_template.md
zoracon Sep 5, 2019
770aa5c
Merge branch 'master' of github.com:EFForg/https-everywhere
zoracon Sep 12, 2019
b997e70
Add base for HTTP Once Prompt
zoracon Sep 12, 2019
48de02c
Merge branch 'master' of github.com:EFForg/https-everywhere into http…
zoracon Sep 13, 2019
163c0d8
set list
zoracon Sep 19, 2019
ac78ca3
establish window session based list
zoracon Sep 19, 2019
67d2f21
cleanup debug code
zoracon Sep 19, 2019
382a8be
Merge branch 'master' of github.com:zoracon/https-everywhere into htt…
zoracon Oct 1, 2019
8f187f1
Merge branch 'master' of github.com:EFForg/https-everywhere into http…
zoracon Oct 1, 2019
fad7d80
Merge branch 'master' of github.com:EFForg/https-everywhere into http…
zoracon Oct 8, 2019
0031366
Add exception for all windows to close before clearing list
zoracon Oct 29, 2019
cbaac4c
Merge branch 'master' of github.com:EFForg/https-everywhere into http…
zoracon Oct 29, 2019
2fe0eb1
Fix file conflict
zoracon Oct 29, 2019
4a69d73
Revert unintended changes
zoracon Oct 29, 2019
3cfae38
Satisfy lint for conditionals
zoracon Oct 29, 2019
1e0d35f
Merge branch 'http-once' of github.com:zoracon/https-everywhere into …
zoracon Oct 29, 2019
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
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< HEAD
***Delete section if irrelevant***

### List related PRs if any
Expand All @@ -9,10 +10,22 @@
- issue link

***May delete note after reading***
=======
## List related PRs if any

- pr link

## List related issues if any

- issue link

*May delete note after reading*
>>>>>>> 342a077a389b0b9441be8c935e300234c7e65a23

### Note to contributor:
Thank you for contributing! If this is a new ruleset and your first time contributing, congratulations! There will be some tests ran through our continuous integration in Travis. For example, checking for duplicate hosts, problematic hosts, etc. in the ruleset file. You will see this testing begin when you open this pull request.

<<<<<<< HEAD
If this is not your first time and you have open PRs that have not been closed or merged, please revisit them by searching: `https://github.com/EFForg/https-everywhere/issues?q=is%3Aopen+assignee%3A[yourusernamehere]`. If there is something not being addressed by other maintainers or a project lead, link them to the PR with your question. Thank you for your patience.

More helpful filters in Pull Request search:
Expand All @@ -24,3 +37,6 @@ More helpful filters in Pull Request search:
`is:pr is:merged author:[your username]`
- Approved PRs:
`is:pr review:approved author:[your username]`
=======
If this is not your first time and you have open PRs that have not been closed or merged, please revisit them by searching: https://github.com/EFForg/https-everywhere/issues?q=is%3Aopen+assignee%3A[yourusernamehere]. If there is something not being addressed by other maintainers or a project lead, link them to the PR with your question. Thank you for your patience.
>>>>>>> 342a077a389b0b9441be8c935e300234c7e65a23
30 changes: 19 additions & 11 deletions chromium/background-scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,16 @@ if (chrome.windows) {
});

// Grant access to HTTP site only during session, clear once window is closed
chrome.windows.onRemoved.addListener( () => httpOnceList.clear() );
chrome.windows.onRemoved.addListener(function() {
chrome.windows.getAll({}, function(windows) {
if(windows.length > 0) {
return;
} else {
httpOnceList.clear();
}
});
});

}
chrome.webNavigation.onCompleted.addListener(function() {
updateState();
Expand Down Expand Up @@ -152,7 +161,7 @@ function updateState () {
const tabUrl = new URL(tabs[0].url);
const hostname = util.getNormalisedHostname(tabUrl.hostname);

if (disabledList.has(tabUrl.host) || httpOnceList.has(tabUrl.host) || iconState == "disabled") {
if (disabledList.has(hostname) || httpOnceList.has(hostname) || iconState == "disabled") {
if ('setIcon' in chrome.browserAction) {
chrome.browserAction.setIcon({
path: {
Expand Down Expand Up @@ -320,9 +329,8 @@ function onBeforeRequest(details) {
browserSession.putTab(details.tabId, 'first_party_host', uri.host, true);
}

if (
disabledList.has(browserSession.getTab(details.tabId, 'first_party_host', null)) ||
httpOnceList.has(browserSession.getTab(details.tabId, 'first_party_host', null)))
if (disabledList.has(browserSession.getTab(details.tabId, 'first_party_host', null)) ||
httpOnceList.has(browserSession.getTab(details.tabId, 'first_party_host', null)))
{
return;
}
Expand Down Expand Up @@ -571,9 +579,8 @@ function onHeadersReceived(details) {

// Do not upgrade resources if the first-party domain disbled EASE mode
// This is needed for HTTPS sites serve mixed content and is broken
if (
disabledList.has(browserSession.getTab(details.tabId, 'first_party_host', null)) ||
httpOnceList.has(browserSession.getTab(details.tabId, 'first_party_host', null)))
if (disabledList.has(browserSession.getTab(details.tabId, 'first_party_host', null)) ||
httpOnceList.has(browserSession.getTab(details.tabId, 'first_party_host', null)))
{
return {};
}
Expand Down Expand Up @@ -669,7 +676,7 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
const disabledListArray = Array.from(disabledList);
const httpOnceListArray = Array.from(httpOnceList);

if ('once' === message) {
if (message === 'once') {
store.set({httpOnceList: httpOnceListArray}, () => {
sendResponse(true);
});
Expand Down Expand Up @@ -860,11 +867,11 @@ chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
return storeDisabledList('once');
},
disable_on_site: () => {
disabledList.add(message.object);
disabledList.add(util.getNormalisedHostname(message.object));
return storeDisabledList('disable');
},
enable_on_site: () => {
disabledList.delete(message.object);
disabledList.delete(util.getNormalisedHostname(message.object));
return storeDisabledList('enable');
},
check_if_site_disabled: () => {
Expand Down Expand Up @@ -900,6 +907,7 @@ function destroy_caches() {
all_rules.ruleCache.clear();
rules.settings.domainBlacklist.clear();
urlBlacklist.clear();
httpOnceList.clear();
}

Object.assign(exports, {
Expand Down
35 changes: 31 additions & 4 deletions chromium/pages/cancel/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ body{
}

.content{
width: 600px;
margin: auto;
text-align: left;
}
Expand All @@ -27,17 +26,25 @@ form, button, p{
}

form{
overflow: auto;
display: inline-flex;
margin-bottom: 1em;
overflow: auto;
}
form#http-once {
margin-left: 8px;
}
form#url-actions-form {
border-right: solid #ec1e1e 1px;
padding-right: 8px;
}

form button{
padding: .5em 1em;
background-color: #aaa;
color: #fff;
border: none;
border-radius: 4px;
color: #fff;
cursor: pointer;
padding: .5em 1em;
}

#url-value{
Expand All @@ -56,3 +63,23 @@ form button{
border: 1px solid #ec1e1e;
color: #ec1e1e;
}

@media screen and (min-width: 600px) {
.content {
width: 600px;
}
}

@media screen and (max-width: 600px) {
.content, img {
width: 100%;
}
form#url-actions-form {
border: none;
}
form#http-once {
margin-left: 0;
}
}