diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index 2fd4391ce9..d176b1e72a 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -14,6 +14,11 @@ } } %> + +<% + response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'"); +%> + <%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Client Tunnel")%> @@ -29,6 +34,7 @@ + @@ -538,7 +544,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; } -
" tabindex="0"><%=destb64%>
+
" tabindex="0" onblur="resetScrollLeft(this)"><%=destb64%>
diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 0185e9c77f..6a2904cca2 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -14,6 +14,11 @@ } } %> + +<% + response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'"); +%> + <%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Hidden Service")%> @@ -29,6 +34,7 @@ + @@ -230,7 +236,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; } -
" tabindex="0"><%=editBean.getDestinationBase64(curTunnel)%>
+
" tabindex="0" onblur="resetScrollLeft(this)"><%=editBean.getDestinationBase64(curTunnel)%>
<% String value3 = editBean.getPrivateKeyFile(curTunnel); @@ -814,7 +820,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; } -
"><%=ab64%>
+
" onblur="resetScrollLeft(this)"><%=ab64%>
diff --git a/apps/routerconsole/jsp/js/resetScroll.js b/apps/routerconsole/jsp/js/resetScroll.js new file mode 100644 index 0000000000..0c7a578d6b --- /dev/null +++ b/apps/routerconsole/jsp/js/resetScroll.js @@ -0,0 +1,15 @@ +// resets scroll position of element +// use with onblur to clear scroll position when element loses focus + + +// reset scroll to left position + +function resetScrollLeft(element) { + element.scrollLeft = 0; +} + +// reset scroll to top position + +function resetScrollTop(element) { + element.scrollTop = 0; +} \ No newline at end of file diff --git a/apps/susidns/src/jsp/addressbook.jsp b/apps/susidns/src/jsp/addressbook.jsp index 627dc6f604..953296185e 100644 --- a/apps/susidns/src/jsp/addressbook.jsp +++ b/apps/susidns/src/jsp/addressbook.jsp @@ -28,7 +28,7 @@ request.setCharacterEncoding("UTF-8"); response.setHeader("X-Frame-Options", "SAMEORIGIN"); - response.setHeader("Content-Security-Policy", "default-src 'self'"); + response.setHeader("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'"); response.setHeader("X-XSS-Protection", "1; mode=block"); response.setHeader("X-Content-Type-Options", "nosniff"); response.setHeader("Referrer-Policy", "no-referrer"); @@ -51,6 +51,7 @@ ${book.book} <%=intl._t("address book")%> - susidns +
@@ -184,7 +185,7 @@ ${book.loadBookMessages} ">b32 ">link "><%=intl._t("details")%> -
${addr.destination}
+
${addr.destination}
"> diff --git a/history.txt b/history.txt index 9d6735f899..05d901477b 100644 --- a/history.txt +++ b/history.txt @@ -1,5 +1,7 @@ 2017-07-26 str4d * Console: + - Add JavaScript snippet to reset dest address scroll position onblur (fixes + Chrome/Blink disappearing text bugs in i2ptunnel and susidns) - /debug: - Add container divs and styling markup - Add top navigation menu