1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 07:22:28 +02:00

Fix management of reload button in popup panel

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1461
This commit is contained in:
Raymond Hill 2021-05-15 10:45:31 -04:00
parent 4d29a4c5d2
commit a24e2a5d6c
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1032,8 +1032,8 @@ const reloadTab = function(ev) {
// if there were changes or not.
popupData.contentLastModified = -1;
// No need to wait to remove this.
document.body.classList.remove('needReload');
// Reset popup state hash to current state.
hashFromPopupData(true);
};
uDom('#refresh').on('click', reloadTab);
@ -1277,7 +1277,7 @@ const pollForContentChange = (( ) => {
/******************************************************************************/
const getPopupData = async function(tabId) {
const getPopupData = async function(tabId, first = false) {
const response = await messaging.send('popupPanel', {
what: 'getPopupData',
tabId,
@ -1287,7 +1287,7 @@ const getPopupData = async function(tabId) {
renderOnce();
renderPopup();
renderPopupLazy(); // low priority rendering
hashFromPopupData(true);
hashFromPopupData(first);
pollForContentChange();
};
@ -1355,7 +1355,7 @@ const getPopupData = async function(tabId) {
document.body.classList.remove('loading');
};
getPopupData(tabId).then(( ) => {
getPopupData(tabId, true).then(( ) => {
if ( document.readyState !== 'complete' ) {
self.addEventListener('load', ( ) => { checkViewport(); }, { once: true });
} else {