Skip to content

Commit

Permalink
Fixed #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Grigorian committed Dec 15, 2020
1 parent 66da3ff commit bd247dc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/CookieViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const styles = theme => ({
height: "100%",
zIndex: 100,
maxWidth: 850,
maxHeight: 555,
maxHeight: 530,
userSelect: "none",
borderRadius: 0,
},
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<style>
html, body, #main {
min-width: 550px;
min-height: 500px;
min-height: 530px;
overflow: hidden;
}
mark {
Expand Down
2 changes: 1 addition & 1 deletion src/theme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = isDark => {
styleOverrides: {
root: {
width: "100%",
margin: "16px 0",
margin: "4px 0",
background: isDark ? "#202124" : "#F8F9FA",
},
},
Expand Down
11 changes: 8 additions & 3 deletions static/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,19 @@ chrome.cookies.onChanged.addListener ( function ({ removed, cause, cookie }) {
if ( !protect ) protect = {}
const key = createCookieKey ( cookie )
if ( [ "explicit" ].includes ( cause ) ) {
if ( !removed && key in block ) {
const isCreatedWhenBlocked = !removed && key in block
const isRemovedWhenProtected = removed && key in protect
const isUpdatedWhenProtected = !removed
&& key in protect
&& serialize ( cookie ) !== serialize ( protect [ key ] )
if ( isCreatedWhenBlocked ) {
chrome.cookies.remove ({
url: getUrl ( cookie ),
name: cookie.name,
})
}
else if ( ( removed && key in protect ) || ( !removed && serialize ( cookie ) !== serialize ( protect [ key ] ) ) ) {
cookie = protect [ key ] ? protect [ key ] : cookie
else if ( isRemovedWhenProtected || isUpdatedWhenProtected ) {
cookie = protect [ key ]
chrome.cookies.set ({
url: getUrl ( cookie ),
domain: cookie.hostOnly ? undefined : cookie.domain,
Expand Down

0 comments on commit bd247dc

Please sign in to comment.