diff --git a/index.js b/index.js index cf0a5e7..e876e1d 100644 --- a/index.js +++ b/index.js @@ -152,7 +152,7 @@ const enableLineWrapping = () => { }; const openInNewTab = () => { - window.open(location.href.replace('&readonly', '')); + window.open(location.href.replace(/[?&]readonly/, '')); }; // Build a shareable URL diff --git a/style.css b/style.css index 550eaae..842fee4 100644 --- a/style.css +++ b/style.css @@ -36,7 +36,8 @@ footer { select, #copy:not(.hidden) + #controls, body.readonly .hide-readonly, -body:not(.readonly) .show-readonly { +body:not(.readonly) .show-readonly, +body.readonly:not(:hover) #footer { display: none; }