S
S
StayAtHome2015-04-01 12:24:02
PHP
StayAtHome, 2015-04-01 12:24:02

How to distinguish a web request from a regular page from a request from the extension itself from a Chrome/Opera extension?

Intercepting a webRequest by calling chrome.webRequest.onBeforeSendHeaders.addListener()

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladimir Skibin, 2018-02-27
@teremok995

If you do so - as written above

$str = "Њ®бЄў , Њ®бЄў , „¬Ёва®ўбЄЁ© Їа®Ґ§¤, 1Ѓ (¬. „¬Ёва®ўбЄ п)";
echo iconv("CP1251", "UTF-8", $str );
then you need to consider what exactly this file you have in what encoding? to prevent double decoding. Save the string to a separate file exactly with 1251 encoding, then read its contents using file_get_contents and only then do iconv.

I
Ilya Beloborodov, 2018-02-27
@kowap

Try this mb-convert-encoding

Y
Yuri Tarakhonich, 2015-04-01
@StayAtHome

In the handler, get details.tabId, if it is -1 then the request was made not from the browser tab.
More here: https://developer.chrome.com/extensions/webRequest...

A
Andrey Surzhikov, 2015-04-01
@Surzhikov

Pass an additional parameter in the request?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question