English 中文(简体)
Chrome Bookmark Search
原标题:

Can you get results from chome.bookmark.search without having to display them?

Update (Answer):

Ok. Maybe my problem is more complex. If I want to use the result globally.

 function _search() {
  var query = $("searchBox").value;
  chrome.bookmarks.search(query, function (bmk){
   var id = bmk[0].id;
   chrome.bookmarks.get(id, function (bmk){
    url=bmk[0].url;
   });
   chrome.tabs.getSelected(null, function (tab){
    chrome.tabs.update(tab.id, {url: url});
    window.close();
   });
  });

This way I could use the list to open one of the results simply by calling

chrome.tabs.create({url:url})
最佳回答

Of course, read the docs:

chrome.bookmarks.search(string query, function callback)

use it this way:

chrome.bookmarks.search(query, function(results) {
   // iterate through results
   // open tabs or whatever
});

Updated: you can obviously copy the "results" into a global var but you can also "process in place".

问题回答

暂无回答




相关问题
Search field with Thickbox issue

i have a search form which is shown with Thickbox inside an iframe. the problem is.. that after i click "search" the result page is shown inside the same iframe! and i want it to be shown in the main ...

Will an incomplete google sitemap hurt my search ranking?

If I submit a sitemap.xml which does not contain all of the pages of my site, will this affect my search ranking? For example: If my sitemap only contained pages that had been created in the last ...

speeding up windows file search with C#

i made a program that search logical drives to find a specific file .if user type file name an click search button , searching begins , but i don t know how to stop searching in the middle of process....

JQuery/MVC Search Issue

I have inherited a piece of work where the entry screen shows a summary of 20 calculated variables. E.g. Var A (250), Var B (79). Clicking on any of these links takes the user to a view with a ...

Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Search by using the keyboard in a list/grid - algorithm

I need to implement a custom search in a grid and I would like to find some user interface guidelines that explain the standard way to implement it. I mean this kind of search that is initiated by ...

Embed Google/ Yahoo search into a web site or build your own

I am looking for an opinion on the whether to use Google custom search, Yahoo search builder or build my own for web projects (no more than 100 pages of content). If I should build my own - do you ...

热门标签