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

  • Home
  • SEARCH
  • 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 6212245
In Process

The Archive Base Latest Questions

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

I am learning to write javascript and Chrome extensions. I want an extension that

  • 0

I am learning to write javascript and Chrome extensions. I want an extension that will show a button, and when a user clicks the button it will add a bookmark folder in the bookmarks.
So far so good (the button appears), but clicking it adds nothing.

I suppose my JavaScript is not correct.

Here is the code:

Manifest:

{
  "name": "My First Extension",
  "version": "1.0",
  "background_page": "background.html",
  "permissions": [
    "tabs", "http://*/*", "bookmarks"
  ],
  "browser_action": {
      "default_icon": "icon.png",
      "name": "HELLO WORLD"
  }
}

background.html:

<html>
<head>
<script>

  function updateIcon() {
    chrome.bookmarks.create({parentId: bookmarkBar.id,
                         title: 'Extension bookmarks'});
                  }

  chrome.browserAction.onClicked.addListener(updateIcon);
  updateIcon();

);
</script>
</head>
</html>    

I suppose it is this part:

function updateIcon() {    chrome.bookmarks.create({parentId: bookmarkBar.id,
                     title: 'Extension bookmarks'});
              }

That code is wrong.

Please, advise me and any good places for learning JavaScript. I have read this web page already.

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

    You have an obvious syntax error.

      function updateIcon() {
        chrome.bookmarks.create({parentId: bookmarkBar.id,
                             title: 'Extension bookmarks'});
                      }
    
      chrome.browserAction.onClicked.addListener(updateIcon);
      updateIcon();
    
    ); // <-- what is this doing here?
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just starting out learning javascript, and tried to write a little script that
I wrote a JavaScript function that fires when the user clicks OK in a
I am a AS3 novice learning PureMVC and want to write code following best
I'd like to write a small JavaScript (framework) that can chain functions with all
I'm writing text to a page using document.write for a Chrome extension, but the
I'm a Delphi, Ruby, and Javascript programmer that is finally learning C - starting
Please bear with me, I'm just learning C++. I'm trying to write my header
I'm brand new to MVC and, as a learning exercise, I'm trying to re-write
Will learning C++ help me build native applications with good speed? Will it help
Many years back, I was told that Javascript was harmful, and I remember being

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.