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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:54:22+00:00 2026-05-28T06:54:22+00:00

I want to created a public database so other extensions can access it, create

  • 0

I want to created a public database so other extensions can access it, create tables, add entities, remove entities what they want.

I saw that the only way to do this is to use message passing between multiple extensions, but this solutions is problematic for me, because I need permission to “management” in order to know the other extensions IDs.

There is an option for sending messages to all extensions without knowing their ID? or there is another way of implementing public db without pub-sub synchronization?

btw – I can use localStorage or WebSQL.

  • 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-28T06:54:23+00:00Added an answer on May 28, 2026 at 6:54 am

    Could you create an extension, hub, that is used to register other extensions and has a messaging hub.

    All of the extensions that wanted to communicate with the public DB could then do it via the hub. Upon initialization from the background page, each extension could register with the hub their ID and which events they want to subscribe to.

    Register action from each extension

    chrome.tabs.sendRequest("hub", {
        action: "register",
        key: "somePrivKey",
        id: "extId", 
        subscribeTo: ["createFoo", "deleteFoo"]
    });
    

    Then, each action performed would be communicated to the hub:

    chrome.tabs.sendRequest("hub", {
        action: "createFoo",
        key: "somePrivKey",
        context: 1
    });
    

    The hub extension would then listen to events. For “register” actions the hub would register the extension as an endpoint for the “subscribeTo” actions. For other actions (“createFoo” or “deleteFoo”) the hub would iterate over the list of registered extensions for the event and perform a sendRequest that sends the “action” name and an optional “context”.

    A shared “key” could be known between the hub and all the extensions that want to communicate to prevent the hub from listening to events not from a known source.

    Hub extension background.js:

    var actionToExtMap = {};
    
    chrome.extension.onRequestExternal.addListener(function(request, sender, sendResponse) {
        if (request.key === "somePrivKey") {
            if (request.action === "register") {
                for (i = 0; i < request.subscribeTo.length; i++) {
                    var action = request.subscribeTo[i];
    
                    var extsionsForAction = actionToExtMap[action] || [];
                    extsionsForAction.push(request.id)
                }
    
            } else if (request.action) {
                var extensionsToSendAction = actionToExtMap[request.action];
                for (i = 0; i < extensionsToSendAction.length; i++) {
                    chrome.extension.sendRequest(extensionsToSendAction[i], {
                        action: request.action,
                        context: request.context //pass an option context object
                    }
                }
            }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a public static class utils.cs I want to use it in
I want to create whois class like that public class DomainInfo { public string
I want to create a class with a nested enum. public class Foo {
I want to create a template class in C#, for example: public class Foo<T>
I created a UIButton programmatically and I want to create an action to handle
I want DBSession.query(Article).group_by(Article.created.month).all() But this query can't using How do I do this using
I created webservice which contain Add function as 'webmethod' when we want to deploy
I created one GWT webapplication project.Inthat i want to create servlet program,but in that
Trying to manage access to a web site I created some necessary entities The
I want to create a voting system, where multiple domain objects can be voted

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.