mirror of https://github.com/gorhill/uBlock.git
Fix management of reload button in popup panel
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1461
This commit is contained in:
parent
4d29a4c5d2
commit
a24e2a5d6c
|
@ -1032,8 +1032,8 @@ const reloadTab = function(ev) {
|
||||||
// if there were changes or not.
|
// if there were changes or not.
|
||||||
popupData.contentLastModified = -1;
|
popupData.contentLastModified = -1;
|
||||||
|
|
||||||
// No need to wait to remove this.
|
// Reset popup state hash to current state.
|
||||||
document.body.classList.remove('needReload');
|
hashFromPopupData(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
uDom('#refresh').on('click', reloadTab);
|
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', {
|
const response = await messaging.send('popupPanel', {
|
||||||
what: 'getPopupData',
|
what: 'getPopupData',
|
||||||
tabId,
|
tabId,
|
||||||
|
@ -1287,7 +1287,7 @@ const getPopupData = async function(tabId) {
|
||||||
renderOnce();
|
renderOnce();
|
||||||
renderPopup();
|
renderPopup();
|
||||||
renderPopupLazy(); // low priority rendering
|
renderPopupLazy(); // low priority rendering
|
||||||
hashFromPopupData(true);
|
hashFromPopupData(first);
|
||||||
pollForContentChange();
|
pollForContentChange();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1355,7 +1355,7 @@ const getPopupData = async function(tabId) {
|
||||||
document.body.classList.remove('loading');
|
document.body.classList.remove('loading');
|
||||||
};
|
};
|
||||||
|
|
||||||
getPopupData(tabId).then(( ) => {
|
getPopupData(tabId, true).then(( ) => {
|
||||||
if ( document.readyState !== 'complete' ) {
|
if ( document.readyState !== 'complete' ) {
|
||||||
self.addEventListener('load', ( ) => { checkViewport(); }, { once: true });
|
self.addEventListener('load', ( ) => { checkViewport(); }, { once: true });
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue