Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is chrome.extension.onRequest deprecated?

I'm building a chrome extension and attempting to attach an event listener to this, but I'm not seeing anything in the console of the background page.

chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
          console.log('REFERRER', request.ref);
        });

This code is in my main.js background page, all my other event listeners (chrome.tabs.onUpdated, chrome.extension.onMessage, etc) are all working fine though.

like image 294
Robeezy Avatar asked Dec 04 '12 18:12

Robeezy


People also ask

Is Chrome getting rid of extensions?

Google is planning to remove inline installation from Chrome for existing extensions starting on September 12th, and Chrome users will be redirected to the Web Store. With Chrome 71 in early December, Google is also planning to remove the inline install API method entirely.

Is a Chrome extension an API?

The chrome. extension API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in Message Passing.

Why is extension grayed out Chrome?

If you see a message saying "Extensions Disabled," it's because Chrome has turned off one or more of your extensions to keep your data safe while you're browsing the Internet. The extensions that Chrome turned off either didn't come from the Chrome Web Store or were determined unsafe.

How do I pin a Chrome extension?

Open the Extensions by clicking the puzzle icon next to your profile avatar. A dropdown menu will appear, showing you all of your enabled extensions. Each extension will have a pushpin icon to the right of it. To pin an extension to Chrome, click the pushpin icon so that the icon turns blue.


1 Answers

Yes, Request was deprecated in favor of 'Message'. So instead of onRequest you should use onMessage, and sendMessage as a replacement for sendRequest.

like image 96
Stan Avatar answered Sep 24 '22 19:09

Stan