瀏覽代碼

Reload page when back button in browser pressed, avoid reading burn
after read paste from cache

Haocen Xu 6 年之前
父節點
當前提交
e298c3d10c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      js/privatebin.js

+ 4 - 0
js/privatebin.js

@@ -5386,6 +5386,10 @@ jQuery.PrivateBin = (function($, RawDeflate) {
             if (Model.hasDeleteToken()) {
             if (Model.hasDeleteToken()) {
                 return;
                 return;
             }
             }
+            // always reload on back button to invalidate cache(protect burn after read paste)
+            window.addEventListener('popstate', () => {
+                window.location.reload();
+            });
 
 
             // display an existing paste
             // display an existing paste
             return me.showPaste();
             return me.showPaste();