I am trying to make a chrome extention that will take text from the omnibox, open a new google doc, and paste the text into that doc. I already have a link that creates new google docs, but how can I put text into from here? I know I can use:
chrome.omnibox.onInputEntered.addListener(
function(text) {
var newURL = "https://docs.google.com/document/create?hl=en";
chrome.tabs.create({ url: newURL });
}
);
To handle the text typed into the omnibox, and open a new doc, it's just the rest of it I can't quite figure out.
EDIT: after some more searching I have found that there is a Google Drive API, I'm not sure if I can use it in an extension or really how to use it.
The Google Drive API is the correct approach, and you can use it from an Extension. There is an example of a Drive extension here https://github.com/GoogleChrome/chrome-app-samples/tree/master/gdrive