Force chrome to open url instead of search - google-chrome

When developing and opening custom urls you always have to type **http://**localurl.local/ in order for Chrome to open page and not google search.
Is there some way you can force google to first try to lookup if page actually exists? And if I already have opened url and append something to string I'm being again redirected to google search which is very frustrating.
If you're not following me see this gif:
preview

Related

Website's internal search URL to use in browser's address bar

There are so many websites what when you enter it's url in address bar and hit the Tab key, browser gets ready to send your query to that specific website. It seems that websites can manage that internal URL.
The question is: How I can specify that internal search URL?
some examples below:
Google Translate
After pressing Tab:
After typing something and press Enter:
As you see, my typed word is in a custom URL (which obviously my Edge doesn't generated it)
Nic.ir
Another Iranian website nic.ir with the same steps.
What this technique is called?

How can I force google docs embedded in iframes to open their links in the same window?

I'm currently making an educational resource with google drive.
I've currently got the "Publish to web" version of the google documents embedded in an iframe in an html document using
<iframe src="https://docs.google.com/document/d/e/2PACX-1vSaUZ2XolOoqc0M12v-VNTTMcz3dIAnAOO9gaCyifoAXhlWiKz114M2QYoQ5d-dNBEsgWDcXahKNMSD/pub" frameborder="0"></iframe>
I've inserted hyperlinks (using the built in hyperlink function) in the google docs, to link to other (published) google docs eg:
https://docs.google.com/document/d/1XnTTbjedXkL3OfeELMwzabeeL4FjnOjarmmWbKb97EY/pub
At the moment, all clicked links are opened in a new tab. This happens whether I link to other google docs, or to external sites. Naturally, this is quite frustrating for navigating the site.
I'd like to have them open either...
in the same iframe
or to another webpage that appears in the same tab (which I could then embed the target document in). I don't really mind which, as long as a new tab isn't created every time someone clicks a link.
I see from similar questions posted that in the past people seem to have had the opposite problem - trying to force the links to open in new tabs, so perhaps something has changed with the way links are handled?
For onlookers, the reason for the varying behavior is due to the query parameter that either is or isn't present as the src value:
You can see that the OP does not have ?embedded=true at the end (after /pub).
<iframe src="https://docs.google.com/document/d/e/2PACX-1vSaUZ2XolOoqc0M12v-VNTTMcz3dIAnAOO9gaCyifoAXhlWiKz114M2QYoQ5d-dNBEsgWDcXahKNMSD/pub" frameborder="0"></iframe>
Google doesn't document the differing functionality very well, but a URL like
https://docs.google.com/document/d/e/2PACX-1vSaUZ2XolOoqc0M12v-VNTTMcz3dIAnAOO9gaCyifoAXhlWiKz114M2QYoQ5d-dNBEsgWDcXahKNMSD/pub?embedded=true
will provide the desired behavior of keeping links opening in-iframe.

how to use google search in googleweblight

I'm trying to browse this url: googleweblight.com/?lite_url=http://www.google.com
but I'm not able to, since I got:
Transcoding test failed:
This page could not be transcoded due to technical issues.
The problem is that I need to copy paste every search result I get from google search page into googleweblight.com/?lite_url=[here]
Why am I not able to use googleweblight for google? How can I make my urls go to googleweblight version directly, without copy and paste and not using a device emulator in user agent?
On Firefox, I am using the UAControl add-on to change my browser's User-Agent to Mobile Safari, and it gives me the mobile version of Google Search, which by default has all search result URLs pointing via GoogleWebLight.
In fact, since I didn't want the URLs to be redirected via GoogleWebLight as such, I had to write a GreaseMonkey script to convert them back to 'regular' (direct) URLs. Maybe you can modify it to do the opposite on the Google Search page, if you're not comfortable with the User-Agent switch approach. I believe you can utilize something like TamperMonkey if you're on a different browser such as Google Chrome.

How extension get the text selected in chrome pdf viewer?

I wrote a chrome extension - english dictionary. You select word, the definition appears.
It works well, but I counter a problem. It seems there is no api of chrome pdf viewer supplied by google.
How can I get the word when i select a word in pdf using chrome pdf viewer?
I will be appreciate if you could help me.
You can get selected text using the context menu. In your background script, adding these lines will allow the user to right-click and do something with the selectionText.
chrome.contextMenus.create({id:"lookup",title:"Lookup %s",contexts:["selection"]});
chrome.contextMenus.onClicked.addListener(function(sel){
console.log(sel.selectionText);
});
Grabbing this text works fine with PDFs, whether part of the extension, or not.
However, you cannot inject a script into a page starting with "chrome-extension://". If this is how your extension works, that will not be (directly) possible. But getting the selected text, and doing something with it still very doable.
As an alternative to requiring script injection, see the notification api, which allows a small message to popup, which could contain the definition of the word.

Google Chrome extension - to open new tab directed to url when a certain url is searched in current tab?

I am very new (started today) to writing chrome extensions but need to write a 'fairly simple' one for tomorrow...
I am really struggling to get my head round it though!
I need to write an extension that opens a new tab or window (whichever is easier!) directed at a predefined url is opened when a certain URL is searched in the current.
An example of this would be if the user typed in www.facebook.com I am trying to get the extension to then open a new tab/window with www.google.com in.
Any help would be much appreciated!
Thanks
Will
In your html of the extension you can specify an anchor tag for the action button which opens a new tab like this
content of the anchor
or if you want to do it programmatically you can
window.open('http://google.com','_newtab');
You cant get at the contents of the omnibox unless you use the omnibox api, which means they have to specify your keyword first before your extension can get at the contents. You could make it open another page once they have gone to a url. You could use a content script that has a matches field that matches the page your interested in and then open a page accordingly.
Content Scripts
http://code.google.com/chrome/extensions/content_scripts.html
Tabs
You can use the tab api to get the current tabs details if your not in a content script. If you are in a content script you can use window.location as stated by Encore PTL. You can also use the tab api to open a tab.
http://code.google.com/chrome/extensions/tabs.html