Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Chrome Socket API in extensions

So after developing an extension for a few hours, assuming that the chrome.socket API would be available to extensions, I load in my extension and I'm told that the Socket API is only available for 'Packaged Apps'.

Does anyone know what's happening, and whether extensions will get the feature (back, since I think they had access when it was in .experimental)?

like image 757
Tom Avatar asked Dec 17 '12 20:12

Tom


People also ask

Does Google Chrome support Websockets?

Chrome developer tools now have the ability to list WebSocket frames and also inspect the data if the frames are not binary.

Why don't you use Chrome sockets on an impact?

Chrome-plated sockets should never be used with an impact driver. Regular chrome-plated sockets can crack or shatter and send pieces flying.


1 Answers

From the Chrome docs:

Packaged apps can act as a network client for TCP and UDP connections.

No, extensions do not have access to the socket API, and they aren't likely to ever get it.

Your confusion is understandable, since what Google called "packaged apps" used to be nothing but glorified extensions with an icon on the home screen. However, Google is now driving a much wider divide between extensions and apps.

Extensions used to have a subset of the functionality the apps did, but now there is mutually exclusive functionality in each. Extensions are meant for enhancing normal Web browsing, whereas apps are meant to be used as stand-alone tools that do not interfere with normal browsing. If you look at the API lists for apps and for extensions, you'll see that the list is vastly different: apps have the powerful hardware- and OS-centric APIs like socket, usb, and bluetooth, while extensions have a monopoly on browser-centric APIs like tabs, cookies, and bookmarks.

like image 162
apsillers Avatar answered Oct 19 '22 08:10

apsillers