[crx] How to open a new URL in the popup window?

10 views
Skip to first unread message

yanivav

unread,
May 5, 2010, 4:00:37 PM5/5/10
to Chromium-extensions
Hi,

How can I open a web URL on the popup window of my extension button
(instead of the local html file which is opened according to the
manifest file)?

I tried:
<script>
window.location(http://'www.google.com');
</script>

But this isn't working...

10x!

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

Arne Roomann-Kurrik

unread,
May 5, 2010, 6:10:14 PM5/5/10
to yanivav, Chromium-extensions
I believe that popup windows can't be redirected to a web URL.  You could probably achieve this effect by creating an iframe to the page you want to display, though.

~Arne

Marcos Aruj

unread,
May 5, 2010, 10:46:39 PM5/5/10
to Arne Roomann-Kurrik, yanivav, Chromium-extensions
I think you can use the setPopup() method to change the url of the popup for the next time it is opened:


Hope it helps,

Marcos.
--
Marcos Aruj Alvarez
Ingeniero de Software
-------------------------------
marco...@gmail.com
-----

Derek 囧

unread,
May 5, 2010, 11:16:03 PM5/5/10
to Chromium-extensions
Use this:

<a href="whateverurl.com" target="_blank">Click me</a>

or

window.open("whateverurl.com","_blank")

Hope this helps you.

On 5月5日, 下午9時46分, Marcos Aruj <marcos.a...@gmail.com> wrote:
> I think you can use the setPopup() method to change the url of the popup for
> the next time it is opened:
>
> http://code.google.com/chrome/extensions/dev/browserAction.html#metho...
>
> <http://code.google.com/chrome/extensions/dev/browserAction.html#metho...>Hope
> it helps,
>
> Marcos.
>
> On Wed, May 5, 2010 at 4:10 PM, Arne Roomann-Kurrik <kur...@chromium.org>wrote:
>
>
>
>
>
> > I believe that popup windows can't be redirected to a web URL.  You could
> > probably achieve this effect by creating an iframe to the page you want to
> > display, though.
>
> > ~Arne
>
> > On Wed, May 5, 2010 at 1:00 PM, yanivav <yani...@gmail.com> wrote:
>
> >> Hi,
>
> >> How can I open a web URL on the popup window of my extension button
> >> (instead of the local html file which is opened according to the
> >> manifest file)?
>
> >> I tried:
> >> <script>
> >>        window.location(http://'www.google.com');
> >> </script>
>
> >> But this isn't working...
>
> >> 10x!
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Chromium-extensions" group.
> >> To post to this group, send email to chromium-extensi...@chromium.org.
> >> To unsubscribe from this group, send email to
> >> chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .
> > For more options, visit this group at
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> --
> Marcos Aruj Alvarez
> Ingeniero de Software
> -------------------------------
> marcos.a...@gmail.com
> -----
>
> --
> You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
> To post to this group, send email to chromium-extensi...@chromium.org.
> To unsubscribe from this group, send email to chromium-extensions+unsubscr...@chromium.org.
> For more options, visit this group athttp://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

PhistucK

unread,
May 7, 2010, 6:59:35 AM5/7/10
to yanivav, Derek 囧, Chromium-extensions
You put the quote after the http://, could that be the problem, or was it just a typo in the e-mail?
It should be
<script>
 window.open('http://www.google.com')
</script>

Also, it might be blocked by the popup blocker? Check the window icon with the red X on top of it at the right of the Omnibar (the location\address bar).

@Derek - no, that will not work without the http://.

☆PhistucK
Reply all
Reply to author
Forward
0 new messages