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 8093565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:31:44+00:00 2026-06-05T20:31:44+00:00

I am currently working on a small extension for Chrome. I need same websql

  • 0

I am currently working on a small extension for Chrome. I need same websql database for the extension, but I get different databases based on where I create them.

If I create the database in the content page, I get the database created for a particular page where user is.

If I create database in the background page then I get extension’s own database. But it is invisible to content pages.

I wish I could access the EXTENSION’s database from content pages, without resorting to clunky message passing mechanism. Is there a way to do that?

  • 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-06-05T20:31:45+00:00Added an answer on June 5, 2026 at 8:31 pm

    This is not possible, same thing as with localStorage. Different scripts represent different contexts.

    All extension scripts can communicate with background page though. Try creating a proxy API to the database on the background page. This should be simple enough.

    I would implement it like this (content script):

    chrome.extension.sendRequest({
          method: 'executeSql', 
          sql: 'SELECT title, author FROM docs WHERE id=?',
          params: [10]
       },
       function(response) {
          //do stuff
       }
    ); 
    

    and on the other end (background page):

    chrome.extension.onRequest.addListener(function(request, sender, sendResponse) {
        console.log(request);
    
        if(request.method == 'executeSql' && request.sql) {
            db.readTransaction(function (t) {
                t.executeSql(request.sql, request.params, function (t, r) {
                   //send result with sendResponse
                }, function (t, e) {
                   //send error with sendResponse
                });
            });
        } else if(...) { //some other method etc.
        } ...
    }
    

    Above code is not tested, it’s just a sketch.

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

Sidebar

Related Questions

I'm currently working on a small short-lived project. But despite the size it's complicated
I'm currently working on a small console application. This application is based on a
I'm currently working on a small 2D game-engine in C++, but I am now
Im currently working on a small project in which I need to model the
I'm currently working on a small dress-up type feature for a friend's website, but
I'm currently working on a small-terminal based game like the good old MUD's, written
I'm currently working on a small jQuery element but having some trouble with clearInterval.
I am currently working on a small ecommerce project. I want to show a
I am currently working on a small personal multiplayer game project. I am using
I'm currently working on a small project to learn Linq where I want to

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.