Is it possible to find out data in websocket using browser - browser

I saw somewhere about some extension, may be only for Chrome, that could reveal data that goes through websocket but I can't find where I read it or possibly I've misunderstand those info. Is there are any way to do this?

Related

Register custom file protocols in Chrome/Firefox extension?

I want to register a custom file protocol in Chrome or Firefox, much like the way Electron does (please see their API for doing this: https://www.electronjs.org/docs/api/protocol). I am wondering if there is a way to implement this as a browser extension, or I have to modify the source code of the browsers.
I expect that the API would look like this (just a pseudocode to help explain what I mean):
registerHandler('myprotocol://', req => {
response('<body>You requested: ' + req.url);
});
Clarification: navigator.registerProtocolHandler is NOT what I need. What it does is to register a protocol that, when clicked, opens an external application to deal with that. But what I want is a protocol handler scheme that works in a request--response way, e.g. can be used in JS/CSS/HTML queries and responds with a content that can be rendered within the browser.
I would answer my own question because I found exactly what I need here: https://github.com/mozilla/libdweb
This is an experimental feature of Firefox Nightly that allows one to register a custom protocol and serve all requests to that protocol using firefox addon. This is not a WebExtension standard nor does it work on browser other than Nightly, but I'm glad to hear that someone is doing this.

Get network data with nodejs

I am looking for a way to get complete data from the network of my own website with nodejs, exactly like in the network tab of the chrome devtool.
But, surprinsingly, I cannot find any information about it.
What I need is actually to get data from requests made by an iframe located on my webpage. But the tricky thing is that these specific requests don`t pass by my server. Is there a way to access these requests as I would in the network tab of chrome?
The only way that I found is to create a chrome plugin, it takes some effort but then I could catch any request.

How to make a WebSocket frame data to hide/mask

Consider the following use-case:
Say I am making the socket request from the browser (consider socket object is available and status is connected):
So if you inspect in the developer tools of chrome/any browser, you will be able to observe something like below:
I was thinking there is a way to mask or send it in binary format how other messaging services are doing on web socket. I tried the following way to send masked/binary
But its showing again as below (it not masked/binary)
This is how it looks on the other messaging services.
I have tried to explore the full documentation on the socket.io npm module. But unfortunately did not find how to do this.
Can anyone put some light on this or any reference to the document link will be of great help.
**Updates**: I found this reference but not able to understand how it can be used on the library i.e. node module socket.io [Data Framing & Masking](https://www.rfc-editor.org/rfc/rfc6455#section-5)

How to pass message from chrome to extension to developer?

I have a small chrome extension that helps users to quickly search for Pokémon Content and I'd like to know if there is a way to pass a message from my users to me...
I'd like to do this to get data from my users, data like what is being searched most, the most used options, things like this for curiosity...
Is there any way to do something like this?
I thought about creating another extension to pass message, but as far as I know, Chrome Extensions can only pass messages to another extension the user has...
So, is there any way to do something like this?
You could send the information to a server and store it in a database, or a log file of some kind. I know I've used multiple chrome extensions of some kind in the past that use a connection to a server hosted by the company/developer that created the plugin.

NodeJS - Stream in what the server is doing

I'm creating a simple webpage with NodeJS that'll upload a picture, resize it, pull some information from the web about the picture, and then save to the database. Easy stuff, all of it done server side. Though I'm trying to write an new feature that I'm a bit lost on how to go about. What I'd like to do is 'print' to the client when it's started each step of the process I mentioned about.
Imagine it like a white box, and every time something happens on the server, a new line is written says what for the client to read. How would I go about this? Any help is appreciated!
Use socket.io or some other websocket library. When the page loads, open a connection (in the browser's javascript). On the server, as events happen, send them as socket.io messages. In the browser, as events arrive, set them into a "status" element or append them to a list or whatever. You should be able to find lots of examples of chat servers out there and just convert chat messages to progress updates and there you have your architecture.
http://howtonode.org/websockets-socketio
Try something, then post a code snippet.

Resources