Chrome Extension for URL Bar pre-load - google-chrome-extension

I am looking to develop a Google Chrome extension that affects the way chrome loads text typed into the URL bar.
Current functionality: if your text matches history / bookmarks it'll pull those up and auto-populate with the suggestion(s) and if you keep typing it'll update it's suggestions or remove them. If you type something that doesn't match any URL (like "test") it'll just do a search for the word(s) on google.com.
Goal: I want to be able to use the extension to listen to the text entered before it sends it to Chrome for loading the site / looking for a search term.
Example: if I type "test" and hit enter, I want the extension to listen to that first, tell Chrome what to do next (load a different site, search for a different word, etc.). Is that possible?
What API's (?) would I use for something like that? Any help would be greatly appreciated.

Related

Chrome Extension Newbie Question - check web page for entries, click hyperlink and refresh

I am just starting out writing my first Chrome plugin so hopefully I ask this question using the right vocabulary. Also looked for other questions that might be the same as this one and didn't find any that covered what I was looking for.
I've read the documentation on creating a Chrome Extension and have done the "Hello World" extension and see it write its output to the background console log. However, I'm not sure exactly how I would structure the extension I want to build between background and content. Any help/pointers (and examples) would be greatly appreciated.
Here's what I'd like the extension to accomplish:
Have it appear in the toolbar where other extensions appear
Have it be able to be enabled/disabled
When enabled:
Read data from the current page
If it finds certain entries "click" on the hyperlink to select them
Sleep for 5 seconds
Repeat the process
Or if there is another extension that does something similar already if you can point me to it maybe I can base my code off the same structure

How can I add Wolfram Alpha to search bar in Chrome?

I want to send queries to Wolfram Alpha real fast. I've been using wiki query from search bar for ages, how can I search on WA?
Ultimately I found the solution myself, but it took me some time and I had to devise the solution myself, since all Google searches returned the extension which I wanted to avoid. Here it is.
Right click the address bar and click Edit search engines...
(or open Settings -> Search -> Manage search engines...)
Usually, you can find all recognized search engines you used already listed there, but if not, add this: (*use any keyword of your choice)
The query url: http://www.wolframalpha.com/input/?i=%s
Now it is possible to use wa query from search bar to search on Wolfram Alpha. Note, this method allows you to use any search engine.
This is really handy! I wonder if adding it in Chrome as a search engine is better than using the Wolfram Alpha chrome extension though. That is much easier to search using just combination of "=" followed by space and you can directly type in your search query to the Math engine :)
Wolfram|Alpha (Official)
Instantly query Wolfram|Alpha from any page or tab.
There is more to it, you can type formula and equations directly in your navigation bar using this on any page or tab. Pretty neat!
[Source]: From Wolfram Alpha Official Chrome Extension page
===FEATURES===
✓ Wolfram|Alpha Button – Access the Wolfram|Alpha query box with just one click. You can also right-click the Wolfram|Alpha icon to change extension options.
✓ Omnibox Shortcut – Transform Chrome's omnibox into a Wolfram|Alpha query field by typing an = sign followed by a space.
✓ Context Menu Shortcut – Highlight text to create queries through a context menu (right-click) entry.
Shouting out to StackOverflow community:
I am still learning and appreciating the power of this engine. If you guys have some resources or content apart from Wolfram's official site, please do share!
This will really help me as a beginner in the field and I can use to improve.
What better way to search than the famous Euler's Identity. In Chrome Nav bar
"=" ==> (space) ==> e^(i*pie) ==> (enter)
Or something like:
"=" ==> (space) ==> sqrt(1779)*cube(pi) ==> (enter)
And see the result instantly in Wolfram. Awesome isn't it?

URL formation in Chrome or Firefox or IE

I have seen this in one of the tutorial videos.
The tutor used firefox and typed in url box like google 'stackoverflow' and it formed the url as https://www.google.com/#q=stackoverflow. (This is just an example).
I think it will be a very useful feature.
Like, i have a ticketing system whose url is always like this - http://ticket-system.com/Tickets.aspx?Ticket=1000 where 1000 is the ticket number.
I want to be able to go to url box in browser and type 'Ticket 1000', and it should form the url by itself and redirect to there.
Any idea how this can be done?
I found my answer here
https://support.google.com/chrome/answer/95653?hl=en&ref_topic=14676
https://support.google.com/chrome/answer/95655
Start typing the web address of the site you want to search in the
address bar. If Google Chrome has a record of the site's search
engine, it automatically offers you the option to search that site. If
you remember the search engine's keyword, you can also type the
keyword in the address bar. Press Tab to choose the search engine,
type your search term, then press Enter.

Can I write into Google Chrome Url Address bar using an extention ?

Can I create a Google chrome extension to change the URL of Google Chrome URL address bar?
Example : If I wrote in the address bar شةثقثىشغشزؤؤخة by wrong, it detects the letters and convert them into English letter to to : amerenaya.com
You can listen to changes in the URL's of the tab using the onUpdated event then you need to determine if there is a litteral keyboard translation and then reload the tab using the update method, unfortunately this will cause the page to reload, but it gets you partially to your solution.

Saving history of usage to offer suggestions

I have a small extension that perform local search.
It searches for the files matching that name in the local company files list and then opens a page with the results.
The extension has a text box where users type in the query.
The problem is that if I click the extension again and want to do a query that I already did previously, I need to type it out again.
I want the textbox to save history, and show suggestions when I start typing a new query.
How can I do this? The suggestion matching can be a very simple string matching, nothing fancy. But how/where canI save the history?
If you are asking about standard browser's autocomplete then I don't think there is a way to programmatically create it.
You can build your own with jQuery's autocomplete plugin, for example. You will just feed it previous queries and it will do the rest.
To store previous queries you can use localStorage, which you would need to access from a background page.

Resources