Chrome has bundled a "native" flashblock for a while, as has the android browser. swfobject reports that the flash player is available, even if the block is enabled for all sites. All I want to do is detect that a user is using native flashblock, and provide some messaging. Certain services, like the Facebook JS SDK, do not work without flash enabled for cross-domain communication, and do not provide methods of detecting failure. I know how to detect an extension/plugin like the original flashblock, but the native version does not appear in the navigator.plugins list.
Is there a way to detect if a user is running with a native flashblock enabled?
Unfortunately, there's no programatic interface to the plugin-loading system in Chrome.
The best you can do is to load a flash object, and poll it via some well-defined method (GetVariable("$version") is the canonical example) to determine success. In the case you're concerned with, flash will show up in navigator.plugins, but won't successfully load your test plugin. It's really not a bad idea to do this sort of check anyway, as there are a number of reasons that flash might not load, above and beyond flash-blocking (native or otherwise).
Related
I want my extension to capture, and inject custom behavior for any GET or POST to a specific URL.
Access to these URLs can be done via
A mouse click
Javascript not written by me
Perhaps another extension/plugin
I will know, however, the FORM POST/GET parameter names (not values). When this occurs I'll create a security dialog of some kind.
Question
How can I capture GET/POST events in a browser extension?
Documentation for plugins it difficult to find on some browsers , and I need to run compiled Mono/.NET code on OS X and PC, so if I abandon the plugin approach I may leverage Safari Extension Companions, Chrome Native Messaging API, or the equivalent in Firefox
Due to compatibility issues with most sites, I don't want to create a dependency on a specific version of JQuery, in case that might somehow mess up the source website.
Since I read Google's message that NPAPI will no longer be supported by the end of 2014, I've been looking for an alternative. The issue is that we currently use a custom made Kinect Browserplugin which we use to control the browser with JS and control Unity Web Player games with your body.
Without NPAPI support it simply won't work anymore and our work will be lost. Google gives NaCl as an alternative but this doesn't support interaction with hardware.
The main question I have is: How to use the Kinect in a webbased platform and crossbrowser?
Currently we have the "normal" Kinect and the Kinect One from the closed beta working in the browser and Unity Web Player.
Please share your thoughts on a solution.
I apologize in advance for just spewing out links without actually supplying much information, but as far as I know there are no known good alternatives.
If I was in your position, I would have a look at the chrome.usb API or possibly, depending on your use case, node-kinect.
Here's a good general resource/discussion of NPAPI alternatives: Browser Plugins in a post NPAPI world
Probably your best approach at this point is to continue using NPAPI except in Chrome, and in Chrome use native messaging. Of course, Chrome has made it as difficult as they can to install the host that you'll be connecting to, so it'll be a pain and you'll have to install the extension and the host seperately, but there you go.
I want to demo a web page being used to interact with a physical object in the same proximity as a web-enabled device (Mac/Windows/Linux laptop). In order to do this, I want to create my own window.bluetooth object in Javascript that will provide an interface to the host device's Bluetooth controller via the Serial Port Profile. For now it's just a demo, but I might want to develop a generic API to abstract Bluetooth drivers in Javascript.
I'm not particularly concerned with portability or generic solutions at this point. I just want to see if it would work on my laptop with a device I'm building using a BlueSMiRF Silver modem. I know Google Chrome extensions are capable of injecting Javascript into every page the user visits, and NPAPI is capable of compiling native OS code into a form that can communicate with Javascript. It looks like someone has done something vaguely similar before with slightly more specific applications.
My question is, is a Chrome extension with NPAPI the best way to do this? Alternatives could be Flash or a Java applet, but those are kind of 1996 solutions. Here are the metrics I use to evaluate a solution:
Feasibility. Is it possible?
Ease of development. How many lines of code would it take?
Leverage. Does anything else out there already do something similar?
For those of you thinking it's preposterous for the browser to monitor lower-level network status, it's already been done with Wi-Fi.
For diagnostic purposes, I need to be able to disable HTML5 in Android's WebView, without disabling Javascript (i.e. keep WebSettings.setJavaScriptEnabled(true);)
To further clarify: I love the ability to play YouTube videos without any Flash plugin installed. It even works with setPluginsEnabled(false). I can do this thanks to WebView's HTML5 built-in support. Now, to test a certain function, I need to trigger DownloadListener.onDownloadStart() with a YouTube video without disabling Javascript.
Is this possible?
Update: Since I posted this question I discovered that at least DOM storage can be disabled. I haven't found a way to disable HTML5 video yet.
I know it's very old question... Still, you may want to check this answer for an idea. The WebSettings class has these methods for enabling/disabling HTML5 features:
setDomStorageEnabled(boolean flag) - Sets whether the DOM storage API is enabled.
setDatabaseEnabled(boolean flag) - Sets whether the database storage API is enabled.
setDatabasePath(String databasePath) - Sets the path to where database storage API databases should be saved.
setAppCacheMaxSize(long appCacheMaxSize) - Note: deprecated in API 18.
setAppCachePath(String appCachePath) - Sets the path to the Application Caches files.
setAppCacheEnabled(boolean flag) - Sets whether the Application Caches API should be enabled.
I am not sure that this question makes much sense. You're not going to be able to "disable" an HTML5 feature in a browser that supports it. The best you can probably do is to set a non-HTML5 doctype on the webpage, but even then most rendering engines (webkit included) will still gladly support those features (<video> tag, <canvas>, etc) that they implement.
It sounds like what you're really trying to do is test what happens with a streaming video on a particular device (with an older?.. version of webkit that doesn't support <video>). Is that right? In this case, I'm not aware of any version of Webkit that has ever been distributed with Android that does not have support for <video>, but I could be wrong.
Is it possible to detect and get proxy server name and port in javascript?
No. The browser proxy settings are not available from JavaScript running in a web page.
Maybe. The browser proxy settings may be available (in some web browsers) from JavaScript running with elevated permissions (for example, a Firefox add-on).
For what it's worth: While you're asking about JavaScript, getting access to the browser proxy settings even from any kind of browser plug-in such as a Flash or Java applet is also not possible, or at the very least not in any reliable or compliant way.
I mention this only because sometimes such plug-ins provide viable workarounds when JavaScript can't do something ... but here I think you are S.O.L.
Perhaps you could tell us a little bit more about what you are trying to accomplish? Maybe there's another way to address your needs.