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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:35:11+00:00 2026-06-03T03:35:11+00:00

New to Chrome programming, but am more or less familiar with Javascript. Goal: A

  • 0

New to Chrome programming, but am more or less familiar with Javascript.

Goal:

A Chrome add-on that will allow me to:

1) Right-click on an link

2) then add a some more characters to that link

3) then reload the page with the new constructed URL.

EX:

A. Object has a link : http://www.address.com/34922

B. User righ-clicks on that object (Chrome’s menu appears [which I know how to mod]), a menu option appears ‘reconstruct rul.’

C. The add-on adds ‘/subfolderA’ to the above mentioned url.

D. Page reloads with the following URL: http://www.address.com/34922/subfolderA

Thanks,
Steve

  • 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-03T03:35:12+00:00Added an answer on June 3, 2026 at 3:35 am

    Use the chrome.contextMenus API, more specifically the create method.

    // Add this to the background page
    chrome.contextMenus.create({
        title: 'Open this link plus /subfolderA',
        contexts: ['link'],
        onclick: function(info, tab) {
            var linkUrl = info.linkUrl;
            // Some logic, eg adding a fragment:
            linkUrl += '/subfolderA';
            // Replace URL on current tab
            chrome.tabs.update(tab.id, {url: linkUrl});
        },
        // The following array should consist of valid match patterns
        //  This context menu item will only be visible on matching links
        targetUrlPatterns: ['http://adress.com/*']
    });
    

    Relevant documentation

    Used methods:

    • chrome.contextMenus API
      • chrome.tabs.create(<object createProperties>)
      • The onClickData type. This is just a plain JavaScript object. However, Chrome will validate this object, and throw an error when an unknown format (e.g. wrong property) is used.
    • chrome.tabs API
      • chrome.tabs.update(<integer tabId>, <object updateProperties>)

    Further reading:

    • Background pages
    • Manifest file
    • Match patterns
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to chrome extensions development and I'm building one that requires a side
I am very new (started today) to writing chrome extensions but need to write
I am fairly new to writing code, but I played around with some chrome
I understand that there are a few ways to create a new Chrome driver
I'm quite new to javascript programming and got stuck in this problem: I have
I'm pretty new to writing Chrome extensions. I've noticed that all of the extensions
I have a site that uses the Facebook JavaScript API to allow users to
Happy new year :) I have a Chrome extension which is a popup that
I am new to the world of creating Chrome extensions. My extension will not
Im new on Google Chrome Extensions coding, and i have some basic questions. I

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.