How to show console.log() in code in Terminal from web extension firefox? - firefox-addon-webextensions

In Web extension Firefox :
How to show or enable console.log() in my code in the terminal , I used "we-ext run -v" command but it show logs of web extension framework not my logs in my code ?

Are you sure your setup is right? For me, console.log() messages are shown in both, browser console and web console.

Related

Chrome extension + webpack - message passing in production mode

I am building a chrome extension in React and webpack. I use chrome messaging API to communicate between the background page and the popup or content script. In the background script, I use browser.runtime.onMessage.addListener and in popup, I use browser.runtime.sendMessage.
In development mode, everything works great. I can easily send messages between the background page and the popup. Sadly when I bundle extension in production mode with code splitting, the messaging API does not work. When browser.runtime.sendMessage is run I get this error message: Error: Could not establish connection. Receiving end does not exist.
Here is a reproduction repo: https://github.com/sleaper/extension-error-reproduction
Can I use webpack in this way?
If you have more questions feel free to ask!

Angular JS Debug Logs

I wrote few logs in my angular js application using the code below. However I am unable to see it displayed either in the console or (chrome -> dev tools) browser console. Where can I see the logs displayed?
console.info(' Maintanence !! ');
console.info(' Next Event = '+ next.name);
use console.log('Maintanence !!');

Angular2 equivalent for angular.version in AngularJS

In the browser's developer console (press F12 to open it), typing the following
"angular.version" will give the version of AngularJS APP loaded on page.
Is there an equivalent of it for Angular2.
There is no equivalent console command, but you can use the following:
getAllAngularRootElements()[0]['attributes'][1];

Error URL pdfMake.js with Ionic Cordova App

I have a problem using pdfMake.js library. This library is supposed to generate PDF, client-side only.
It works well with chrome, Firefox...
But when I launch my ionic app on a device (Android in my case), I have the following error :
CordovaWebViewImpl﹕ Blocked (possibly sub-frame) navigation to non-allowed URL: data:application/pdf;base64,JVBERi0xLjMKJf39/f0KNiAwIG9iago8PAovVHlwZSAvRXh0R1.......
I encountered this problem before with AngularJs for example for Blobs...and using the following configuration worked :
$compileProvider.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|chrome-extension|blob):/);
BUT not here... :(
Do you have any idea how to allow the data/pdf ?
Thanks !
You have to add permissions to your App inside manifest.xml file

Google app engine python logging not working

I can't print to the browser console despite trying the code below.
import logging
logging.getLogger().setLevel(logging.DEBUG)
logging.debug("print this.")
None of the Python logging will get out to the browser console.
All the logs messages go out to the project dashboard (https://appengine.google.com/logs?&app_id=s~your-project), or to STDIO when developing locally.
If you want to see logging messages on the browser console, those have to be called by Javascript on the web page!

Resources