1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-06-02 18:34:52 +12:00

fix reload button (regression from 2256552899)

This commit is contained in:
Raymond Hill 2018-09-30 05:37:04 -04:00
parent 77a7b8febe
commit fc0bb7a35c
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -555,14 +555,16 @@ var pageSelectorChanged = function() {
/******************************************************************************/ /******************************************************************************/
var refreshTab = function() { var reloadTab = function(ev) {
var tabClass = document.getElementById('pageSelector').value; let tabId = document.getElementById('pageSelector').value;
var matches = tabClass.match(/^tab_(.+)$/); if ( /^\d+$/.test(tabId) === false ) { return; }
if ( matches === null ) { return; }
if ( matches[1] === 'bts' ) { return; }
vAPI.messaging.send( vAPI.messaging.send(
'logger-ui.js', 'default',
{ what: 'forceReloadTab', tabId: parseInt(matches[1], 10) } {
what: 'forceReloadTab',
tabId: parseInt(tabId, 10),
bypassCache: ev && (ev.ctrlKey || ev.metaKey || ev.shiftKey)
}
); );
}; };
@ -1078,7 +1080,7 @@ window.addEventListener('beforeunload', releaseView);
readLogBuffer(); readLogBuffer();
uDom('#pageSelector').on('change', pageSelectorChanged); uDom('#pageSelector').on('change', pageSelectorChanged);
uDom('#refresh').on('click', refreshTab); uDom('#refresh').on('click', reloadTab);
uDom('#compactViewToggler').on('click', toggleCompactView); uDom('#compactViewToggler').on('click', toggleCompactView);
uDom('#clean').on('click', cleanBuffer); uDom('#clean').on('click', cleanBuffer);
uDom('#clear').on('click', clearBuffer); uDom('#clear').on('click', clearBuffer);