mirror of
https://github.com/gorhill/uBlock.git
synced 2024-10-04 16:47:15 +02:00
[mv3] Do not pollute browser console in stable release versions
This commit is contained in:
parent
4f6fa840c3
commit
02966afb8c
@ -131,11 +131,22 @@ export const broadcastMessage = message => {
|
|||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
const ubolLog = (...args) => {
|
const ubolLog = (...args) => {
|
||||||
// Do not pollute dev console in stable release.
|
// Do not pollute dev console in stable releases.
|
||||||
if ( browser.runtime.id === 'ddkjiahejlhfcafbddmgiahcphecmpfh' ) { return; }
|
if ( shouldLog !== true ) { return; }
|
||||||
console.info('[uBOL]', ...args);
|
console.info('[uBOL]', ...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const shouldLog = (( ) => {
|
||||||
|
const { id } = browser.runtime;
|
||||||
|
// https://addons.mozilla.org/en-US/firefox/addon/ublock-origin-lite/
|
||||||
|
if ( id === 'uBOLite@raymondhill.net' ) { return false; }
|
||||||
|
// https://chromewebstore.google.com/detail/ddkjiahejlhfcafbddmgiahcphecmpfh
|
||||||
|
if ( id === 'ddkjiahejlhfcafbddmgiahcphecmpfh' ) { return false; }
|
||||||
|
// https://microsoftedge.microsoft.com/addons/detail/cimighlppcgcoapaliogpjjdehbnofhn
|
||||||
|
if ( id === 'cimighlppcgcoapaliogpjjdehbnofhn' ) { return false; }
|
||||||
|
return true;
|
||||||
|
})();
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
@ -124,6 +124,13 @@ fi
|
|||||||
echo "*** uBOLite.mv3: extension ready"
|
echo "*** uBOLite.mv3: extension ready"
|
||||||
echo "Extension location: $DES/"
|
echo "Extension location: $DES/"
|
||||||
|
|
||||||
|
# Local build: use a different extension id than the official one
|
||||||
|
if [ -z "$TAGNAME" ]; then
|
||||||
|
tmp=$(mktemp)
|
||||||
|
jq '.browser_specific_settings.gecko.id = "uBOLite.dev@raymondhill.net"' "$DES/manifest.json" > "$tmp" \
|
||||||
|
&& mv "$tmp" "$DES/manifest.json"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$FULL" = "yes" ]; then
|
if [ "$FULL" = "yes" ]; then
|
||||||
if [ -n "$BEFORE" ]; then
|
if [ -n "$BEFORE" ]; then
|
||||||
echo "*** uBOLite.mv3: salvaging rule ids to minimize diff size"
|
echo "*** uBOLite.mv3: salvaging rule ids to minimize diff size"
|
||||||
|
Loading…
Reference in New Issue
Block a user