From 21ce55f1cd26601c672765210b8c64b1fc628f26 Mon Sep 17 00:00:00 2001 From: Thomas Mathews Date: Fri, 20 Jan 2023 09:53:33 -0800 Subject: [PATCH] Security update: no script attributes --- css/styles.css | 38 +++++++++++++--------------- index.html | 54 +++++++++++++++++++-------------------- js/main.js | 2 +- js/ui/fmt.js | 2 +- js/ui/render.js | 37 ++++++++++++++------------- js/ui/state.js | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 134 insertions(+), 66 deletions(-) diff --git a/css/styles.css b/css/styles.css index a3781e3..4f8ec3b 100644 --- a/css/styles.css +++ b/css/styles.css @@ -98,20 +98,21 @@ th, td { #nav > div[data-active] img.active { display: none; } -#nav > div[data-active="home"] [role="home"] img.inactive, -#nav > div[data-active="explore"] [role="explore"] img.inactive, -#nav > div[data-active="notifications"] [role="notifications"] img.inactive, -#nav > div[data-active="settings"] [role="settings"] img.inactive, -#nav > div[data-active="messages"] [role="dm"] img.inactive { +#nav > div[data-active="home"] [data-view="friends"] img.inactive, +#nav > div[data-active="explore"] [data-view="explore"] img.inactive, +#nav > div[data-active="notifications"] [data-view="notifications"] img.inactive, +#nav > div[data-active="settings"] [data-view="settings"] img.inactive, +#nav > div[data-active="messages"] [data-view="dm"] img.inactive { display: none; } -#nav > div[data-active="home"] [role="home"] img.active, -#nav > div[data-active="explore"] [role="explore"] img.active, -#nav > div[data-active="notifications"] [role="notifications"] img.active, -#nav > div[data-active="settings"] [role="settings"] img.active, -#nav > div[data-active="messages"] [role="dm"] img.active { +#nav > div[data-active="home"] [data-view="friends"] img.active, +#nav > div[data-active="explore"] [data-view="explore"] img.active, +#nav > div[data-active="notifications"] [data-view="notifications"] img.active, +#nav > div[data-active="settings"] [data-view="settings"] img.active, +#nav > div[data-active="messages"] [data-view="dm"] img.active { display: block; } + #app-icon-logo > img { width: 36px; height: 36px; @@ -145,26 +146,26 @@ button.nav > img.icon { width: 28px; height: 28px; } -#gnav button[role="open-gnav"] { +#gnav button[action="toggle-gnav"] { z-index: var(--zGlobal); padding: 15px; } -#gnav.open button[role="home"] { +#gnav.open button[data-view="friends"] { top: -375px; } -#gnav.open button[role="explore"] { +#gnav.open button[data-view="explore"] { top: -300px; } -#gnav.open button[role="dm"] { +#gnav.open button[data-view="dm"] { top: -225px; } -#gnav.open button[role="notifications"] { +#gnav.open button[data-view="notifications"] { top: -150px; } -#gnav.open button[role="notifications"] .new-notifications { +#gnav.open button[data-view="notifications"] .new-notifications { right: 9px; } -#gnav.open button[role="settings"] { +#gnav.open button[data-view="settings"] { top: -75px; } @@ -282,9 +283,6 @@ button.nav > img.icon { .event-content > .info { display: inline-block; } -.event-content > .info button[role="view-event"] { - margin-left: 10px; -} .username, .thread-id { font-weight: 800; font-size: var(--fsReduced); diff --git a/index.html b/index.html index d1941a9..7c8caa5 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ + content="default-src 'none'; manifest-src 'self'; connect-src 'self' ws: wss:; script-src 'self'; script-src-elem 'self'; script-src-attr 'none'; style-src 'self' fonts.googleapis.com; img-src http: https: data:; media-src *; font-src 'self' fonts.gstatic.com; child-src 'none';" /> Yo, Sup @@ -47,13 +47,13 @@

The blue bird experience for Nostr.

-

- @@ -61,25 +61,25 @@
- @@ -90,29 +90,29 @@ - - - - - @@ -172,7 +172,7 @@
-
@@ -248,7 +248,7 @@ @@ -257,7 +257,7 @@