Просмотр исходного кода

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

Haocen Xu 6 лет назад
Родитель
Сommit
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()) {
                 return;
             }
+            // always reload on back button to invalidate cache(protect burn after read paste)
+            window.addEventListener('popstate', () => {
+                window.location.reload();
+            });
 
             // display an existing paste
             return me.showPaste();