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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:59:38+00:00 2026-05-26T00:59:38+00:00

I have a simple bookmarking app that I am developing to learn Google App

  • 0

I have a simple bookmarking app that I am developing to learn Google App Engine. At this point I copy and paste the url into http://ting-1.appspot.com/submit which has a form that has a url field. Since this is cumbersome I thought of adding a chrome extension. I just changed the hello world example so that now I get the url of the tab with this code (as explained here):

  <script>
    window.addEventListener("load", windowLoaded, false);
    function windowLoaded() {
      chrome.tabs.getSelected(null, function(tab) {
        document.getElementById('currentLink').innerHTML = tab.url;
        tabUrl = tab.url;
      });
    }
document.write(tabUrl)
  </script>

How do I pass tabUrl to http://ting-1.appspot.com/submit?

Thanks!

Update

background.html that I used as adapted from Mohamed Mansour’s answer:

<script>
    //React when a browser action's icon is clicked.
    chrome.browserAction.onClicked.addListener(function(tab) {
        //this gets the url and the title
        chrome.tabs.getSelected(null, function(tab) {
            tabUrl = tab.url
            tabTitle = tab.title

        //this posts the data to the bookmarking app 
        var formData = new FormData();
        formData.append("url", tabUrl);
        formData.append("title", tabTitle);
        formData.append("pitch", "this is a note");
        formData.append("user_tag_list", "tag1, tag2");
        var xhr = new XMLHttpRequest();
        xhr.open("POST", "http://ting-1.appspot.com/submithandlertest");
        xhr.send(formData);
        });
    });
</script>
  • 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-26T00:59:38+00:00Added an answer on May 26, 2026 at 12:59 am

    You use normal XHR (XMLHttpRequest) request. I would place that in your background page. Follow the example here, https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest. I believe you want to submit data as well, so don’t forget that. I think you wanted a POST request too. From the example on MDC, you can relate it this way:

    var formData = new FormData();
    formData.append("username", "Groucho");
    formData.append("accountnum", 123456);
    var xhr = new XMLHttpRequest();
    xhr.open("POST", "http://ting-1.appspot.com/submit");
    xhr.send(formData);
    

    Make sure you have the URL in your manifest for getting permissions to do that request.

    "permissions": [
      "tabs",
      " http://ting-1.appspot.com/submit"
    ],
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have simple C# console app which imports text data into SQL. It takes around
I have simple code that does a head request for a URL and then
I have simple app in my project. This app works without any problem. I
I have simple query that loads data from two tables into GUI. I'm saving
I have simple win service, that executes few tasks periodically. How should I pass
I have simple SSIS package which reads data from flat file and insert into
I have simple SSIS package where I import data from flat file into SQL
I have simple WinForms application where modifying Windows Registry. The problem is that in
I have simple from written on C/gtk+ and i have function in this appliction.
I have simple template that's html mostly and then pulls some stuff out of

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.