Show URL for popup window

6,937 views
Skip to first unread message

Garrett Lewis

unread,
Sep 11, 2015, 9:37:31 PM9/11/15
to Chromium-extensions
I added a button in my extension that opens a popup window for users to login to a website. The only issue is the URL bar isn't shown so users may believe it to be a phishing forum and report it, even though you could prove to yourself it's the real login.

All I need is the URL bar to show. It does this when you click a link and it opens a popup on normal websites, but opening a popup window using the chrome.windows.create method doesn't (that I'm aware of). What's the best way to fix this?

Garrett Lewis

unread,
Sep 11, 2015, 9:40:09 PM9/11/15
to Chromium-extensions
I switched the mode from popup to normal and it shows the URL, but I didn't want an entire new window, just a popup window that's temporary. If you use an entirely new window then it's not a popup as desired.

Antony Sargent

unread,
Sep 14, 2015, 2:09:52 PM9/14/15
to Garrett Lewis, Chromium-extensions
You might try using the regular open web window.open API - see the "location" value for the window features argument as documented here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/64950aa3-b294-46e0-bca6-b61847292fd0%40chromium.org.

Garrett Lewis

unread,
Sep 14, 2015, 5:44:59 PM9/14/15
to Chromium-extensions, du...@dubtech.biz
I believe I tried this and when I did I got a popup blocked message, which I don't want users to have to deal with to use it (it should work from the start). I thought it wouldn't do this if it was initiated by a user action (clicking a link) but it still did.


On Monday, September 14, 2015 at 2:09:52 PM UTC-4, Antony Sargent wrote:
You might try using the regular open web window.open API - see the "location" value for the window features argument as documented here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open

On Fri, Sep 11, 2015 at 6:40 PM, Garrett Lewis <du...@dubtech.biz> wrote:
I switched the mode from popup to normal and it shows the URL, but I didn't want an entire new window, just a popup window that's temporary. If you use an entirely new window then it's not a popup as desired.

On Friday, September 11, 2015 at 9:37:31 PM UTC-4, Garrett Lewis wrote:
I added a button in my extension that opens a popup window for users to login to a website. The only issue is the URL bar isn't shown so users may believe it to be a phishing forum and report it, even though you could prove to yourself it's the real login.

All I need is the URL bar to show. It does this when you click a link and it opens a popup on normal websites, but opening a popup window using the chrome.windows.create method doesn't (that I'm aware of). What's the best way to fix this?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Antony Sargent

unread,
Sep 15, 2015, 5:31:32 PM9/15/15
to Garrett Lewis, Chromium-extensions
Were you putting the link in one of your extension's own pages, or injecting it onto another site with a content script? I just tried with a link on a page in an extension and it seemed to work for me:

page.html inside my extension
<html>
<body>
<a id="the_link" href="https://www.google.com">click here</a>
<script src="page.js"></script>
</body>
</html>

page.js inside my extension
document.getElementById("the_link").onclick = function() {
  window.open("https://www.google.com", "Google", "location=yes");
  return false;
};




On Mon, Sep 14, 2015 at 2:44 PM, Garrett Lewis <du...@dubtech.biz> wrote:
I believe I tried this and when I did I got a popup blocked message, which I don't want users to have to deal with to use it (it should work from the start). I thought it wouldn't do this if it was initiated by a user action (clicking a link) but it still did.

On Monday, September 14, 2015 at 2:09:52 PM UTC-4, Antony Sargent wrote:
You might try using the regular open web window.open API - see the "location" value for the window features argument as documented here: https://developer.mozilla.org/en-US/docs/Web/API/Window/open

On Fri, Sep 11, 2015 at 6:40 PM, Garrett Lewis <du...@dubtech.biz> wrote:
I switched the mode from popup to normal and it shows the URL, but I didn't want an entire new window, just a popup window that's temporary. If you use an entirely new window then it's not a popup as desired.

On Friday, September 11, 2015 at 9:37:31 PM UTC-4, Garrett Lewis wrote:
I added a button in my extension that opens a popup window for users to login to a website. The only issue is the URL bar isn't shown so users may believe it to be a phishing forum and report it, even though you could prove to yourself it's the real login.

All I need is the URL bar to show. It does this when you click a link and it opens a popup on normal websites, but opening a popup window using the chrome.windows.create method doesn't (that I'm aware of). What's the best way to fix this?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.

Garrett Lewis

unread,
Sep 15, 2015, 7:57:01 PM9/15/15
to Chromium-extensions
I tried this and it still doesn't work. It still pops up the same way and the other parameters still work (height and width) but the address bar doesn't show.


HTML:
<a href="#" id="show_login" title="Login" class="left"><i class="material-icons orange-text text-lighten-1">vpn_key</i></a>

My script:
$("#show_login").on('click', function() {
    window.open("http://example.com/register.php", "login", 'location="yes", height="600", width="800"');
});

On Friday, September 11, 2015 at 9:37:31 PM UTC-4, Garrett Lewis wrote:

Antony Sargent

unread,
Sep 16, 2015, 1:21:13 PM9/16/15
to Garrett Lewis, Chromium-extensions
Huh, maybe the problem is with the href='#' or perhaps something about the way your library function is attaching your onclick listener?

I'd suggest starting with the exact code in my example which works as far as I can tell, and iteratively modifying it in the direction of what you want and see where it starts to break. 


--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Message has been deleted
Message has been deleted

Garrett Lewis

unread,
Jan 2, 2016, 11:52:25 PM1/2/16
to Chromium-Extensions-Announce
I know it's been a while since this has been replied to, I sort of gave up on the issue for the time being to focus on the actual extension itself rather than the small detail of the url bar showing. I'm still having this issue however and to be specific, it's a (icon) link in the popup page that appears when you click the extension's icon. I've tried the script you suggested as well including the HTML for it, but it still doesn't seem to work.

For the moment the only option seems to be to open a new tab to complete the process but it sort of defeats the ability for a quick link to perform an action then exit.


On Wednesday, September 16, 2015 at 1:21:13 PM UTC-4, Antony Sargent wrote:
Huh, maybe the problem is with the href='#' or perhaps something about the way your library function is attaching your onclick listener?

I'd suggest starting with the exact code in my example which works as far as I can tell, and iteratively modifying it in the direction of what you want and see where it starts to break. 

On Tue, Sep 15, 2015 at 4:57 PM, Garrett Lewis <du...@dubtech.biz> wrote:
I tried this and it still doesn't work. It still pops up the same way and the other parameters still work (height and width) but the address bar doesn't show.


HTML:
<a href="#" id="show_login" title="Login" class="left"><i class="material-icons orange-text text-lighten-1">vpn_key</i></a>

My script:
$("#show_login").on('click', function() {
    window.open("http://example.com/register.php", "login", 'location="yes", height="600", width="800"');
});

On Friday, September 11, 2015 at 9:37:31 PM UTC-4, Garrett Lewis wrote:
I added a button in my extension that opens a popup window for users to login to a website. The only issue is the URL bar isn't shown so users may believe it to be a phishing forum and report it, even though you could prove to yourself it's the real login.

All I need is the URL bar to show. It does this when you click a link and it opens a popup on normal websites, but opening a popup window using the chrome.windows.create method doesn't (that I'm aware of). What's the best way to fix this?

--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extensions+unsub...@chromium.org.

To post to this group, send email to chromium-...@chromium.org.
Visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/.
Reply all
Reply to author
Forward
0 new messages