This repository has been archived by the owner on Oct 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
draft: add quick issue reporter to nano adblocker
- Loading branch information
1 parent
2c35d37
commit d159e9d
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
diff --git a/platform/chromium/vapi-common.js b/platform/chromium/vapi-common.js | ||
index 9396b47a..ac486d41 100644 | ||
--- a/platform/chromium/vapi-common.js | ||
+++ b/platform/chromium/vapi-common.js | ||
@@ -138,6 +138,23 @@ vAPI.download = function(details) { | ||
|
||
vAPI.getURL = chrome.runtime.getURL; | ||
|
||
+vAPI.nanoOpenBugReporter = function() { | ||
+ const reporter = vAPI.getURL('/reporter/index.html'); | ||
+ | ||
+ chrome.tabs.query({ | ||
+ active: true, | ||
+ currentWindow: true, | ||
+ }, (tabs) => { | ||
+ if (chrome.runtime.lastError || tabs.length === 0) { | ||
+ return; | ||
+ } | ||
+ | ||
+ chrome.tabs.create({ | ||
+ url: reporter + '?' + tabs[0].id | ||
+ }); | ||
+ }); | ||
+}; | ||
+ | ||
/******************************************************************************/ | ||
|
||
vAPI.i18n = chrome.i18n.getMessage; | ||
diff --git a/src/js/popup.js b/src/js/popup.js | ||
index 79def108..1c41379f 100644 | ||
--- a/src/js/popup.js | ||
+++ b/src/js/popup.js | ||
@@ -450,6 +450,7 @@ const renderPopup = function() { | ||
uDom.nodeFromId('gotoPick').classList.toggle('enabled', canElementPicker); | ||
uDom.nodeFromId('gotoZap').classList.toggle('enabled', canElementPicker); | ||
uDom.nodeFromId('nanoForceEnableScroll').classList.toggle('enabled', canElementPicker); | ||
+ uDom.nodeFromId('nanoOpenBugReporter').classList.toggle('enabled', canElementPicker); | ||
|
||
let blocked = popupData.pageBlockedRequestCount, | ||
total = popupData.pageAllowedRequestCount + blocked, | ||
@@ -759,6 +760,8 @@ const nanoForceEnableScroll = function() { | ||
vAPI.closePopup(); | ||
}; | ||
|
||
+const nanoOpenBugReporter = vAPI.nanoOpenBugReporter; | ||
+ | ||
/******************************************************************************/ | ||
|
||
const gotoURL = function(ev) { | ||
@@ -1153,6 +1156,7 @@ uDom('#switch .fa-icon').on('click', toggleNetFilteringSwitch); | ||
uDom('#gotoZap').on('click', gotoZap); | ||
uDom('#gotoPick').on('click', gotoPick); | ||
uDom('#nanoForceEnableScroll').on('click', nanoForceEnableScroll); | ||
+uDom('#nanoOpenBugReporter').on('click', nanoOpenBugReporter); | ||
uDom('#nanoFirewallPaneToggle').on('click', toggleFirewallPane); | ||
uDom('#refresh').on('click', reloadTab); | ||
uDom('.hnSwitch').on('click', toggleHostnameSwitch); | ||
diff --git a/src/popup.html b/src/popup.html | ||
index 48f78ec3..7f5cd9d4 100644 | ||
--- a/src/popup.html | ||
+++ b/src/popup.html | ||
@@ -25,6 +25,7 @@ | ||
<p id="basicTools2"> | ||
<span id="gotoZap" class="fa-icon tool" data-i18n-tip="popupTipZapper" data-tip-position="under">bolt</span> | ||
<span id="nanoForceEnableScroll" class="fa tool" data-i18n-tip="nano_p_force_scroll" data-tip-position="under"></span> | ||
+ <span id="nanoOpenBugReporter" class="fa tool" data-i18n-tip="nano_p_bug_reporter" data-tip-position="under"></span> | ||
</p> | ||
<h2 id="dfToggler" data-i18n="popupBlockedRequestPrompt"> </h2> | ||
<p class="statName"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters