mirror of https://github.com/gorhill/uBlock.git
Report cosmetic filters as popup panel property
This commit is contained in:
parent
8c376d7791
commit
620a96531c
|
@ -615,9 +615,6 @@ const onMessage = function(request, sender, callback) {
|
|||
if ( vAPI.net.hasUnprocessedRequest(request.tabId) ) {
|
||||
request.popupPanel.hasUnprocessedRequest = true;
|
||||
}
|
||||
const supportURL = new URL(vAPI.getURL('support.html'));
|
||||
supportURL.searchParams.set('pageURL', request.pageURL);
|
||||
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
|
||||
vAPI.tabs.executeScript(request.tabId, {
|
||||
allFrames: true,
|
||||
file: '/js/scriptlets/cosmetic-report.js',
|
||||
|
@ -628,8 +625,11 @@ const onMessage = function(request, sender, callback) {
|
|||
return a;
|
||||
}, []);
|
||||
if ( filters.length !== 0 ) {
|
||||
supportURL.searchParams.set('cosmetic', JSON.stringify(filters));
|
||||
request.popupPanel.cosmetic = filters;
|
||||
}
|
||||
const supportURL = new URL(vAPI.getURL('support.html'));
|
||||
supportURL.searchParams.set('pageURL', request.pageURL);
|
||||
supportURL.searchParams.set('popupPanel', JSON.stringify(request.popupPanel));
|
||||
µb.openNewTab({ url: supportURL.href, select: true, index: -1 });
|
||||
});
|
||||
return;
|
||||
|
|
|
@ -151,9 +151,6 @@ function showData() {
|
|||
}
|
||||
if ( reportedPage !== null ) {
|
||||
shownData.popupPanel = reportedPage.popupPanel;
|
||||
if ( reportedPage.cosmeticFilters ) {
|
||||
shownData.cosmeticFilters = reportedPage.cosmeticFilters;
|
||||
}
|
||||
}
|
||||
const text = JSON.stringify(shownData, null, 2)
|
||||
.split('\n')
|
||||
|
@ -200,14 +197,9 @@ const reportedPage = (( ) => {
|
|||
select.append(option);
|
||||
}
|
||||
dom.cl.add(dom.body, 'filterIssue');
|
||||
let cosmeticFilters;
|
||||
if ( url.searchParams.has('cosmetic') ) {
|
||||
cosmeticFilters = JSON.parse(url.searchParams.get('cosmetic'));
|
||||
}
|
||||
return {
|
||||
hostname: parsedURL.hostname.replace(/^(m|mobile|www)\./, ''),
|
||||
popupPanel: JSON.parse(url.searchParams.get('popupPanel')),
|
||||
cosmeticFilters,
|
||||
};
|
||||
} catch(ex) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue