1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Report specific filter issue through a template

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1541#issuecomment-966697347
This commit is contained in:
Raymond Hill 2021-11-12 09:11:28 -05:00
parent dea7184f30
commit e1c386515a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 7 additions and 31 deletions

View File

@ -183,36 +183,12 @@ function reportSpecificFilterType() {
} }
function reportSpecificFilterIssue(ev) { function reportSpecificFilterIssue(ev) {
const bodyTemplate = [ const githubURL = new URL('https://github.com/uBlockOrigin/uAssets/issues/new?template=specific_report_from_ubo.yml');
'## Address of the web page', const issueType = reportSpecificFilterType();
'', githubURL.searchParams.set('title', `${reportSpecificFilterHostname()}: ${issueType}`);
'`{{url}}`', githubURL.searchParams.set('url_address_of_the_web_page', '`' + reportURL.href + '`');
'', githubURL.searchParams.set('category', issueType);
'## Type of issue', githubURL.searchParams.set('configuration', configToMarkdown(false));
'',
'{{type}}',
'',
'## Description (when issue is not obvious)',
'',
'[none]',
'',
'## Screenshot (when description is difficult)',
'',
'[none]',
'',
'## Configuration',
'',
'{{configuration}}',
].join('\n');
const githubURL = new URL('https://github.com/uBlockOrigin/uAssets/issues/new');
const issueType = document.querySelector('[data-i18n="supportS6Select1"] ~ select').value;
const title = `${reportSpecificFilterHostname()}: ${reportSpecificFilterType()}`;
const body = bodyTemplate
.replace('{{url}}', reportURL.href)
.replace('{{type}}', issueType)
.replace('{{configuration}}', configToMarkdown(false));
githubURL.searchParams.set('title', title);
githubURL.searchParams.set('body', body);
vAPI.messaging.send('default', { vAPI.messaging.send('default', {
what: 'gotoURL', what: 'gotoURL',
details: { url: githubURL.href, select: true, index: -1 }, details: { url: githubURL.href, select: true, index: -1 },

View File

@ -50,7 +50,7 @@
<p data-i18n="supportS3P3"> <p data-i18n="supportS3P3">
</div> </div>
<div> <div>
<button id="filterReport" type="button" data-url="https://github.com/uBlockOrigin/uAssets/issues/new?template=bug_report_from_ubo.yml" data-i18n="supportOpenButton"></button> <button id="filterReport" type="button" data-url="https://github.com/uBlockOrigin/uAssets/issues/new?template=report_from_ubo.yml" data-i18n="supportOpenButton"></button>
</div> </div>
</div> </div>
<hr> <hr>