navigator.wakeLock property is missing in some Chrome browsers - javascript

I have written some HTML/JS page and if I open the page on different machines (laptop vs. PC) with the very same version of Chrome, one browser has the navigator.wakeLock property but the other one has not.
Debugger shows wakeLock property
Debugger shows no wakeLock
Chrome current version
I'm puzzled.
As far as I know Chrome supports wakeLock. And does obviously on the laptop.
But why not on my PC?
Both run Windows 10.

Related

Possible to run a chrome extension within another chrome extension?

Long story short I'm looking to create a Chrome extension that will run within a site that only wants to run Internet Explorer (Oracle EBS). So far my only option has been to run IE Tab, which works fine when visiting the site. My new extension right now just runs alert("foo"); once a page loads and that works fine as well.
The new extension does not run in IE Tab though. Using IE Tab changes the URL to:
chrome-extension://IE_Tab's_extension_ID/nhc.htm#url=site_url
and nothing happens. Is there a way to run the extension within the IE tab extension? If anyone has an alternative idea as well I'm open to suggestions.
FYI, I ended up not doing much with IE tab or chrome. Placing a script into it's nhc.htm worked but ended up being slower and clunkier than my solution.
Instead I resorted to just using the old version of Chromium 44 (make sure it's Chromium, not chrome) and enabling the NPAPI in the chrome://flags/#enable-npapi. It's outdated tech, but really it's just there to occasionally run specific Java apps along with the new chrome extension, not replace their current browser.

Is it possible to remote debug Chrome on iOS?

I am able to successfully debug Safari on iOS 8.4 using Google's ios-webkit-debug-proxy. But it never sees my Chrome tabs on the iPad. I've also tried using the desktop Chrome browser at chrome://inspect but that also doesn't show it.
Is it possible to remote debug Chrome on iOS? Or is this not possible?
I use Vorlon. http://vorlonjs.com/ It is a free open source project from MS and uses websockets to connect to the remote device. Not as good as full chrome dev tools but you can inspect/edit the dom, view console logs etc.

Unable to set breakpoint in chrome app

I seemed to have lost the ability to set a breakpoint in a chrome app. I tested with a chrome-app-sample and my old app in both canary and stable chrome with both chrome versions open simultaneously on a mac as well as only one open at a time.
Whether I try to set a breakpoint programmatically with debugger; or set the breakpoint in the sources tab of the Developer Tools app, I can not seem to stop on code that I am 100% confident is executed.
Version 41.0.2258.2 canary (64-bit)

How to view JavaScript console on Android (and iOS)?

I am creating a purely browser based app - HTML and JavaScript.
I do not have an Android IDE installed (nor one for iOS) - and would prefer not to have to install one and perform remote debugging.
Developing on my PC, I use the Chrome browser and the developer tools to view the JavaScript console in order to debug.
How can I do that on an Android tablet (or, later, iOS)? I prefer a purely browser based solution, but could accept an Android/iOS based app.
Try https://github.com/liriliri/eruda
All you need to do is add this snippet on top of the page:
<script src="https://cdn.jsdelivr.net/npm/eruda"></script>
<script>eruda.init();</script>
And you get an interactive set of developer tools similar to those in Chrome and Firefox. Here's a screenshot:
Just released for iOS, Chrome 73 now supports the option to see console.log.
If you’re a website developer, you can now view JavaScript console
messages. Navigate to chrome://inspect to enable, then perform desired
actions in another tab. Switch back to the same chrome://inspect tab
to view any printed JavaScript console logs.
see here in "What's New" section or in "version history" 73.x version.
For Android you can use remote debugging through chrome as described here
I'll summarize/rewrite the steps (for browser based debugging) here in case the link ever goes down.
Requirements:
For browser tabs: Android 4.0+ and Chrome for Android
A USB cable to plug in your Android device
Chrome 32 or later installed on your development machine
Set up:
Enable USB debugging on your device.
Navigate to chrome://inspect/#devices on your desktop Chrome browser. (Alternatively, to get to the same screen, you can select Chrome menu > Tools > Inspect Devices)
After connecting, you may see an alert on the device requesting permission for USB debugging from your computer. Tap OK
Chrome should now display the connected device
Open up chrome on your Android device and navigate to the page you want to debug/inspect. The page should show up on your desktop browser and you should be able to inspect it.
If for some reason you have an older version of chrome and cannot upgrade. There is a plugin that you can install to accomplish the same thing.
I was searching for a while for something like this. Firebug Lite used to be an option but has been abandoned. Before discovering eruda (as mentioned elsewhere in this thread), I developed my own open source console. It's pretty light on features, but it does the main things - capture JS errors, and allow you to run commands to inspect variables and object on your page.
Here's a demo:
It's activated by just placing this script tag on your page:
<script src="https://cdn.jsdelivr.net/gh/SimonEast/MiniConsoleJS#main/console.js"></script>
Open source, GPL licence. Available at: https://github.com/SimonEast/MiniConsoleJS/

Why does Firefox suddenly disable Javascript by itself?

I am using Firefox 28.0 on Mac OS 10.6.8. Sometimes during web development, probably after my application crashes, Firefox suddenly disables Javascript in one particular tab. So my application would be all weird and not work until I restart Firefox. The script panel would say that the page has no scripts, and if I open another page with Javascript in the same tab, it would not work either.
Is it some kind of safety feature? Is it documented anywhere? Note that I also have Firebug installed, and I managed to crash Firefox by profiling my app in Firebug on more than one occasion.
I checked about.config; javascript.enabled is set to true.

Categories