mirror of https://github.com/gorhill/uBlock.git
Disable button until benchmark session is completed
This commit is contained in:
parent
4059a92838
commit
a1aa9bd54f
|
@ -42,7 +42,7 @@
|
|||
</div>
|
||||
<hr>
|
||||
<div id="dev">
|
||||
<button id="sfneBenchmark">Benchmark static filtering engine</button>
|
||||
<button id="sfneBenchmark" type="button">Benchmark static filtering engine</button>
|
||||
<div id="sfneBenchmarkResult"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -43,13 +43,14 @@
|
|||
|
||||
document.getElementById('dev').classList.add('enabled');
|
||||
|
||||
const sfneBenchmark = async ( ) => {
|
||||
const result = await vAPI.messaging.send('dashboard', {
|
||||
document.getElementById('sfneBenchmark').addEventListener('click', ev => {
|
||||
const button = ev.target;
|
||||
button.setAttribute('disabled', '');
|
||||
vAPI.messaging.send('dashboard', {
|
||||
what: 'sfneBenchmark',
|
||||
});
|
||||
}).then(result => {
|
||||
document.getElementById('sfneBenchmarkResult').textContent = result;
|
||||
};
|
||||
document.getElementById('sfneBenchmark').addEventListener('click', ( ) => {
|
||||
sfneBenchmark();
|
||||
button.removeAttribute('disabled');
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Reference in New Issue