Chrome Extension - Load popup whenever Facebook is visited? - google-chrome

I'm just starting on a Chrome extension. I want it to load a popup element whenever the browser loads a Facebook url.
Is this possible? And how? // ANSWERED.
Okay, then.
Now, I now how to make an extension that drops down in a small window at the top right of the page beneath the extension icons. *But how can I create a new div anywhere on the web page, like this buzzgrowl extension:http://buzzgrowl.com/ *?

Yep it's possible. You can trigger a popup in your javascript. Set it to work only on facebook.com.
You can also do javascript checking of the url via window.location.

Related

Refreshing a page opened with window.location.replace or window.open(url,'_self') takes me to previous window

I have a published google web app that I am using as a splash screen. When I click a button on this screen it correctly takes me to the page (using either of the methods below). When I refresh that page, however, it returns me to the splash screen instead of keeping me on the newly opened screen, as I'd like it to do. I thought window.location.replace would correct this, but it is still doing it.
I have tried window.open(myurl,'_self') and window.location.replace(myurl) and it keeps happening. If I create a new tab with just window.open(myurl) and I refresh that, it keeps me on the correct page. I would prefer to not have the user open a bunch of tabs for this to work correctly. Is there something I am missing to make this refresh to the page that was opened with the window command?
Since your app is loaded in a sandboxed iframe, you should use
window.open(myurl,'_top')
to load in the top frame

Chrome Extension installation popup

When an extension is installed in chrome, a popup comes up which says [Extension_name] has been added to chrome.
This is the default popup having extension icon and some message. I want to modify this popup data. is there any api which we can use to modify it.
There is no such API, but you can use onInstalled event to open new tab with your own description.
In addition to Deliaz's answer, you can create either a browser action or a page action popup. You can change popup html dynamically to make it look completely different depending on the situation but you can't open it programmatically (desktop notifications could be used for alerts).
Here's another reference which might also help.

add olark chat window to arbitrary url with chrome extension?

I would like to make a chrome extension that includes adding an olark window to any webpage on click of the browser action button. olark customer support wasn't sure if this was possible but thought it might be. is there any reason why this wouldn't work?
I've been working on it using the
document.body.appendChild(script); method to add the olark snippet, is this a reasonable approach?

Google Chrome vs extension

I want to build app that would allow me to open website, select some data from this website and send them to my server. I imagine that it works in this way:
Application id displayed in browser sidebar sidebar
I open certain website
Select address (City) on opened website
Click "City" button on sidebar
"City" value is copied from website to sidebar
Select address (Zip code) in browser
Click "Zip code" button on side bar
"Zip code" value is copied from website to sidebar
... (and so on)
Finally I click "submit" button on sidebar and data is send to server.
What will be better option for such use case? Chrome app or chrome extension? I am not sure if there is way to display sidebar using chrome extension. I also haven't seen in reference option to open certain url in chrome app. Any advises will be appreciated.
I guess an extension would be more appropriate as it is just one click away from the website you want to select some data from. The user interaction could be done in various ways:
select text and use the context menu (right mouse click) to activate the extension logic
activate extension via toolbar and add UI as a part of the website being viewed or in a separate window
You can pop up a window, but it will disappear when you click back on the website. You can manually create a "sidebar" by having your extension open a new window whose url is inside the extension and subsequently manually placing it alongside the browser window.
Unfortunately there is no sidebar feature for chrome extensions. That would be cool if there were, though.

Display Chrome extension popup at middle of page

I am new to writing chrome extensions and was wondering how can i do the following.
How can i make the popup(when someone clicks on extension icon) display at the center of the webpage instead of displaying the popup at the top right corner ?
Use chrome.browserAction.onClicked.addListener(), which fires "when a browser action icon is clicked." Then inject your popup manually into the DOM of the supplied tab, using something like chrome.tabs.executeScript().
Also consider adding a context-menu item, which might make more sense to a user depending on what your extension actually does.