Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7590367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:22:59+00:00 2026-05-30T20:22:59+00:00

I am just starting writing chrome extension. I need an advice on what should

  • 0

I am just starting writing chrome extension.
I need an advice on what should I use for this extension: content script with background page or just a background page.

This is what extension does (I just choose this requirements for my first extension)
Runs only on news.google.com
Finds news blocks that have certain “sources” of news, for example “USA Today” and then sets lightblue background on all divs that have this source.

I already wrote a content script for this using jquery, which is super easy.
But now I want to also set a pageAction icon if any of my “sources” were found on the page, also I would like to add listener for that content button that would toggle the highlighting of my found sources on and off.

I discovered that this cannot be done from content script.

So now I have a dilemma: should I rewrite my extension to use only background page OR keep content script and use message passing to pass message to background page if any sources were found, then have script in background page set the pageAction, add listener for it?

I am looking for advice from someone who has real world experience with these things.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:23:00+00:00Added an answer on May 30, 2026 at 8:23 pm

    You have to use both. background_page can’t access the content of tabs and content_scripts can’t create/listen to pageActions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just starting out, this should be a simple one but I haven't been able
I'm just starting out writing this code and when I add in the db
I am writing a bouncing ball class (I'm just starting to use Java) and
I just starting to play around with iOS and web services. I'm writing a
I am just starting out with writing jQuery plugins. I wrote three small plugins
I haven't started writing any code for this program, but here's what I need
I'm just starting to learn Android development and writing my first app. I started
So I'm just starting out with template metaprogramming and I have been writing a
I'm just starting to use git for my thesis and my question is what
Background: I'm writing my first pgTAP test cases for a PL/pgSQL function and starting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.