mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Handle 'No tab with such id'
This commit is contained in:
parent
091141f2cf
commit
182a443cc4
|
@ -16,6 +16,8 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
const chromified = window.utils.chromified;
|
||||||
|
|
||||||
window.chrome.browserAction.setBadgeBackgroundColor({
|
window.chrome.browserAction.setBadgeBackgroundColor({
|
||||||
color: '#db4b2f',
|
color: '#db4b2f',
|
||||||
});
|
});
|
||||||
|
@ -47,8 +49,14 @@
|
||||||
|
|
||||||
chrome.browserAction.getTitle(
|
chrome.browserAction.getTitle(
|
||||||
{tabId: requestDetails.tabId},
|
{tabId: requestDetails.tabId},
|
||||||
(title) => {
|
chromified((err, title) => {
|
||||||
|
|
||||||
|
if (err) {
|
||||||
|
// E.g., no tab with such id happens.
|
||||||
|
// Because requestDetails may be stale.
|
||||||
|
console.log('Notifier error ignored:', err);
|
||||||
|
return cb();
|
||||||
|
}
|
||||||
const ifTitleSetAlready = /\n/.test(title);
|
const ifTitleSetAlready = /\n/.test(title);
|
||||||
|
|
||||||
const hostname = new URL( requestDetails.url ).hostname;
|
const hostname = new URL( requestDetails.url ).hostname;
|
||||||
|
@ -118,7 +126,7 @@
|
||||||
|
|
||||||
return cb();
|
return cb();
|
||||||
|
|
||||||
}
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const commonContext = {
|
const commonContext = {
|
||||||
version: '0.25',
|
version: '0.26',
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.contexts = {};
|
exports.contexts = {};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user