enabling Firefox 5.0 javascript dump() - javascript

I'm going through firefox extension writing bootcamp and somewhere along the way the video's author is speaking about switching browser.dom.window.dump.enabled in about:config to true. This option is no longer present in firefox 5.0. From what I read during my google searches, in ff 4.0 you had to create this preference yourself, and it seems like in firefox 5.0 it doesn't work anymore - I can't seem to dump information to firefox error console any more (regardless of whether console2 is enabled or not).
Relevant code:
Here's how I'm launching the browser:
/usr/bin/iceweasel -profile /some/path -no-remote -jsconsole
And here's the code that only shows the alert, without writing anything to the error console:
onCommand: function(event) {
toJavaScriptConsole("toJavaScriptConsole: hello world");
dump("Hello world!\n");
alert("Hello world!\n");
}
Any idea what I can do to have working dump() called from the ff extension I'm working on in firefox 5.0?

You confused the error console with plain linux console - if you run firefox from terminal you should see the dumps right there.
in-depth explanation

This preference was never present by default - you always had to create it and set to true. Also, the output doesn't go to Error Console, it is rather visible in the terminal you start Firefox from. If you happen to test on Windows you should specify -console command line flag to open a terminal window for the output, on Linux simply starting Firefox from a terminal window will do.

Related

webauthn yubico example not working on Firefox

I'm trying to run the this project: https://github.com/YubicoLabs/java-webauthn-passwordless-workshop
On Chrome and Edge it works fine, but with Firefox I can't register my Yubikey (no Error Log, Key does not light up and waits for a touch) or authenticate with a previously registered Key (Key lights up and notices the touch)(DOM Exception: An attempt was made to use an object that is not, or is no longer, usable)
Now I'm quite curious what is causing this behaviour. Is it a Problem with my Firefox config? (aboout:config wenbauthn variables are true) Or is something wrong with the project?
Using:
Win 10
Firefox 80.0.1 (also tried 71)
Security Key by Yubico

Is Firefox dev tools able to catch all the error?

Since Firebug was discontinued I had to started using the Dev Tools.
I was debugging a page, when I was clicking a button it was not firing the event. I realized a function was not defined, the JS file reference was missing, however, the Dev Tools did not tell me about it.
Trying my old still installed Firebug it threw something like "ReferenceError: foo function is not defined".
Do I need to enable any options more for Dev Tools? or isn't Dev Tools able to catch all the errors?
UPDATE
Test case
<script type="text/javascript">
function DoSomething(e){
e.preventDefault();
foo();
}
</script>
Click me!
You need to ensure that the "JS" filter is enabled within the Console panel.
If that doesn't help to see the error, you may try the new console frontend. In Firefox prior to version 55 this can be enabled by going to about:config and setting the preference devtools.webconsole.new-frontend-enabled to true. In that new UI ensure that the filters "Errors" and "Warnings" are enabled.
If you still can't see the error logged, it's probably a bug in the DevTools. In that case you should try whether you can reproduce the problem in a new Firefox profile. If you can also reproduce it in the new profile, you should report the bug (if there isn't one already; bug 755553 seems to be related) and either profile a URL to a page where the error occurs or attach a reduced test case.

RecordRTC audio+canvas recording does not run

I am trying to implement the RecordRTC javascript library, the audio+canvas recording one in particular, but for some reason the demo code does not run on my browser at all. I have tried chrome, IE, and Firefox.
The demo is: https://www.webrtc-experiment.com/ffmpeg/audio-plus-canvas-recording.html
My console shows this message:
console
I tried using this previous help RecordRTC.js:37 Uncaught MediaStream is mandatory
That fixed the console error I got, but the demo still didn't do anything.
Console always ends at audio/wav -> 246 KB.
Please help.Thanks.

Protractor + Safari non-secure form warning

os: OS X El Capitan
node:v5.4.1
protractor: 3.3
safari: 9.0.3
I'm getting a security warning popup in in my test and I was wondering if there is a way to get around it in any fashion. The popup security warning doesn't seem to come up on chrome and browser.switchTo().alert(); doesn't seem to work?
this is what the alert/security warning looks like
Apparently they block mixed content and it doesn't seem like there is an option anymore to change
Why is mixed content blocked in Safari
I have tried to press Tab then Enter b/c that works manually but it seems to give an error when i use this code
browser.actions().sendKeys(protractor.Key.TAB).sendKeys(protractor.Key.ENTER).perform();
Failed: Unknown command: {"id":"z4v9sab7uay","name":"sendKeysToActiveElement","parameters":{"value":[""]}} (WARNING: The server did not provide any stacktrace information)

Using ios_webkit_debug_proxy on linux

I am trying to use the description from https://github.com/google/ios-webkit-debug-proxy to debug my website on iPhone (Running iOS 7.1.2).
I compiled ios_webkit_debug_proxy, and is running it with
ios_webkit_debug_proxy -d
I then start google-chrome and point it to localhost:9222/ which shows my iPhone, and the website it is currently visiting. I then copy/paste the link address(chrome-devtools://devtools/bundled/devtools.html?host=localhost:9222&page=1) into a new chrome tab, and then I get a debug window which shows
Elements,Network,Sources,Timeline,Profiles,Resources,Audits,Console.
But none of theese buttons shows any real content. There is no dom. No javascript. No output in the console view. No activity in the network. Its like debugging a empty view.
My ios_webkit_debug_proxy -d console, shows a new message, each time my iPhone
visits a new website. But it shows no other activity. THe messages start with something like
ss.remove_fd(7)
ss.recv fd=13 len=0
ss.remove_fd(13)
ss.recv fd=12 len=221
wi.recv[221]:
And they do just as far as I can see, contain the website url, but not any real content from the website.
The console I started chrome from, shows the message:
"Uncaught TypeError: Cannot read property 'frame' of undefined", source: chrome-devtools:/
I am using Fedora 20.
Does anyone have any clue why this does not work ?
Thanks
It isn't clear to me if you switch the browser to localhost:9222/ after you get a pair of lines like:
Listing devices on :9221
Connected :9222 to Will's iPhone (8a48ac86edd4f299xxxxxxxxxxxxxxx)
if you don't see the second line, then it means that probably you have issues with usbmuxd or libimobiledevice.
I've had some issues myself with the proxy, but then i was able to use it with satisfaction. In my experience, there are few things that make the life easier:
1) Run the usbmuxd as root and possibly with options -fv so that it doesn't detach from the tty and you see what happens. In my Debian installation it is run wit a system user in background;
2) In order to avoid the crash of the proxy when an unhandled exception happens don't use the debugger release of your chrome/chromium but instead use a pretty older one https://chrome-devtools-frontend.appspot.com/static/18.0.1025.99/devtools.html (see https://github.com/google/ios-webkit-debug-proxy/issues/63)

Categories