views:

23

answers:

1

Hello,

I am starting to write a extention for chrome. For this extention I like to add automatically the url on the bar to an text field of my extention. When I click on my extention u popup shows a form with a field. The value must be set to the URL of the page i Visit.

I work normaly with Jquery, and maybe the answer can fit in the jquery.

I hope I enplane everything well and thank you for any answer

Update:

This must be the answer

     populateForm();
function populateForm() {
  chrome.tabs.getSelected(null,function(tab) {
    console.debug(tab);
    naam.value = tab.title;
    url.value = tab.url;
    }
    )};
A: 

Your brackets and parentheses are misplaced. Try using this:

function populateForm() {
    chrome.tabs.getSelected(null, function (tab) {
        console.debug(tab);
        naam.value = tab.title;
        url.value = tab.url;
    });
}
populateForm();
Pauan