A
A
alkhankhel2013-04-22 10:18:56
JavaScript
alkhankhel, 2013-04-22 10:18:56

Is it possible to create an extension for Chrome with such functionality

- There is a certain tab, the extension remembers this tab, and initially finds it at a certain url.
- When there are requests for this url or this url + #hash, I need them to open in that remembered tab. It is important that the activation of that tab.

I would like to hear whether it is possible to implement this, and what chrome - API for this look.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
C
cjmaxik, 2013-04-22
@cjmaxik

That is, so that links to the same site open in the same tab?

U
UZER2006, 2013-04-22
@UZER2006

Of course you can. It may not be possible to prevent opening, but an open tab can then be closed. Everything else is completely doable. See the API for tabs (there are listeners for creating), and/or for handling requests (webRequest, for example).
Also, if necessary, you can even add a content script to each page that will add the necessary listeners to the necessary links.

R
radarlog, 2013-04-22
@radarlog

This extension has the following functionality

S
spmbt, 2013-04-23
@spmbt

Do special. scripts where links to the form can come across are not at all interesting, then it’s easier for me to stir up via websocket, postMessage or sessionStorage, without any extensions and cross-browser ...
F in fact, why do you need an extension if it is implemented through localStorage with a slight delay. The form tab polls the variable from the store; if a message arrives, the focus is taken, the action is performed. And on the form call pages, there are simple scripts that disable opening in a new tab and create this variable in the storage (URL of the link), if Chrome. PostMessage may also encounter message failures here due to Chrome's policy. Another option is Custom Events , but also, most likely, there will be barriers between tab branches.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question