Chrome API to detect file downloads - javascript

I need to write a Chrome extension to track file download dates and speeds.
Is there any Google Chrome API to detect when a file starts/ends downloading?
Thanks,
-J.

There's something in the pipe right now!
http://developer.chrome.com/extensions/downloads.html

No, not at the time of writing.
The Chrome extensions API documentation doesn't currently cover such functionality.
The experimental downloads API doesn't cover the functionality you need but may be worth checking back on as changes are made.

Tracking starting and stopping can be done with onCreated/onChanged/search(), which are implemented and will probably be released out of experimental into the dev branch in a couple weeks or so. I'll make an announcement on the Google Chrome Developers G+ stream.
Tracking the speed of the download can be approximated, but the speed that is displayed in the shelf and chrome://downloads is not directly accessible via the extension api as currently spec'd. We'll consider exposing the information if there's a use case that can't be met well enough by approximation.
No firm plans yet on when the api will be released to the stable branch.

Related

Get CPU Usage detail in browser [duplicate]

I noticed this today in my Chrome.
Google Meet is showing a chart of CPU usage in their "Troubleshooting" panel. I'm wondering if there's an existing API for this or is it a clever trick I'm not aware of.
I was curious about this as well when I saw the CPU Usage graph on the Troubleshooting page on the Google Meet's page. So googled a lot and I couldn't find any proper answer as to how it is being achieved apart from this link: https://developer.chrome.com/extensions/system_cpu#method-getInfo.
So, I went through the minified source code of the Google Meet's site and it turns out Google Meet is using this but not on their webpage directly, because it is for chrome extensions only, but through the Google Hangouts Extension which is present in Chrome, Brave and the new Microsoft Edge (Chromium-based).
The chrome extension is calling the chrome.system.cpu API to get the information about the processor, core count, temperatures, etc., and these details are being passed to the Google Meets page via window.postMessage API and Message Passing between Chrome Extension and a Webpage.
This is a neat little way to achieve this if you are the creator of the browser :P.
Most probably, they are using Chrome specific API since this will not work on other browsers.
The closest thing that I've found is https://developer.chrome.com/extensions/system_cpu#method-getInfo
Below is a screenshot from Firefox stating that this will work only on Chrome.

How can I link to a chrome extension in Chrome Web Store when I'm not the developer?

I've seen the "How to link to chrome extension like Chrome Web Store?" question from Oct. 2011, and I tried to implement it.
However, I realized after some testing that the approach described in answer to that question regarding Inline Installation only works in situations where the original developer of the extension links to his own creation in the Chrome Web Store.
I have a daily podcast that I post to my website, and I want to provide a one-click link for Chrome users to click in order to install The RSS Aggregator extension (which I did NOT develop) directly, so that desktop visitors using Chrome can view my podcast feed in a formatted page rather than just seeing XML code.
Since I'm not the original creator of The RSS Aggregator extension, I don't see a way for me to accomplish this.
For the moment, I'm sending visitors to the Chrome Web Store to install it there, but I've been getting feedback from tech-averse visitors that they can't figure out how to install it without step-by-step installation instructions. Sadly, there are still a lot of people out there who have trouble handling something as simple as adding an extension to their Chrome browsers.
Hence my desire to provide a one-click solution on my site.
Is there a way I can implement a solution on my site?
Never used it before, but maybe this helps you:
https://developer.chrome.com/webstore/inline_installation#cws-link

Chrome Extension packing while developing - any better way?

I do some chrome extension (web music play/stop) as a hobby project.
At the moment my process is like this:
Disable chrome store version
Make changes
Pack extension
Remove previous version of extension
Drag'n'drop new dev version
When I think I'm done, I upload the final zip to the dashboard, remove dev version and turn back on the chrome store version.
So this looks quite hard and not rational. Guess there is another way to do it.
Maybe I've just missed a good part of the manual, please point me to.
Answer by #devnull69
You even don't need to disable the chrome store version because the
local / unpacked version will have a different extension id and can
easily be run in parallel to the webstore version
https://developer.chrome.com/extensions/getstarted#unpacked

Chrome Packaged Apps: Check if 'Experimental Extension APIs' flag is enabled

I happen to be working on some changes to a proof-of-concept app I already have in the Chrome Web Store that are indeed awesome: the chrome.app.window.create() option that allows developers to bake Aura/Ash transparency into their windows (right now, there's actually a static image set as the app's background). Since the app is only really meant for Chrome OS users anyway, the fact that it depends on Ash to function is really no problem on my part.
However, there's a stumbling block. Thank God it doesn't actually require the experimental permission, as that would ban an update to the app from entering the CWS, but still, the only way the window will truly be transparent is with the Experimental APIs flag enabled. So, is it possible to check if the Experimental Extension APIs are enabled to fall back on the app's packed wallpaper in case they aren't?
This API is still being developed, and has not completely gone through our API approval process, so it might change. That's why it is listed as experimental :) You shouldn't ship an app relying on this API in its current state as it will likely break.
Having said that, part of the plan is to allow you to detect, via the API, whether the feature is available. This is so your app will be able to work on platforms like Windows XP that won't support transparency.

Adding audio/video calls in HTML5 app

I'm working on HTML5 app that lets several users to work on one document. I need to add a possibility for users (editing the same document) to talk to each other. And I just don't know how to start with that. Here are my questions
Is there an HTML5 lib allowing to transfer sound from microphone between clients?
What about streaming video from camera?
What is an easiest server-side solution for that?
Any thoughts are strongly appreciated! So don't be shy! :)
UPD: please note that I need an abbility for more then two users to talk.
For this you can use WebRTC.
However, this is a very young and unfinished technology that as already stated is currently available only in Chrome stable and Firefox beta. This means there will probably come changes to the current spec, something to be aware of in case of early implementation. But it allow you to use video and audio communication directly in the browser.
Quick-start here:
http://www.html5rocks.com/en/tutorials/webrtc/basics/
Other options are Flash based plugins such as flash-videoio. This is an open source plugin but will naturally require Adobe Flash installed. This may or may not be a problem depending on the company's security policy.
For technical details on implementation please see examples on the provided links.
For many-to-many you can use either:
"Mesh" - everybody connects to everybody. This however is costly on CPU and mobiles are often left out.
"Star" - everybody goes through the most capable device. However, with many connections this will soon run slow for the device handling all connections.
MCU. Specialized server to handle all connections. If mixes audio and video and handles drop-outs as well without affecting the other callers.
Examples of MCU's:
http://sourceforge.net/projects/mcumediaserver/ (open source)
http://www.medooze.com/products/mcu.aspx (commercial)
you are searching for navigator.getUserMedia()
that allows the various users to share video audio and data.
the support is very low... only chrome and the latest verions of opera and firefox support it.
and totally no support on mobile devices... maybe in the next android chrome... dunno
as there is much to talk about and i have no clue on how u wanna setup everything i suggest u read a little more about that on the urls...
http://caniuse.com/stream
http://www.html5rocks.com/en/tutorials/getusermedia/intro/
http://dev.w3.org/2011/webrtc/editor/getusermedia.html
https://developer.mozilla.org/en-US/docs/WebRTC/navigator.getUserMedia
http://my.opera.com/core/blog/2011/03/23/webcam-orientation-preview
http://simpl.info/getusermedia/
and SERVERSIDE solution nahh... thats not a good solution
clientside is the way to go.
Not sure if you're required to do it yourself from scratch or are able to use third party libraries/tools.
In which case I would recommend using Tokbox which has support for WebRTC and SDK for iOS.
Their API is simple and easy to use.

Categories

Resources