Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1507 Open new tab in incognito mode #1508

Merged
merged 3 commits into from Mar 5, 2015

Conversation

wadkar
Copy link
Contributor

@wadkar wadkar commented Feb 27, 2015

This PR is a fix for issue #1507

  • Change openUrlInNewTab to pass selected tab.windowId
  • Change createTab to use openUrlInNewTab

 - Change openUrlInNewTab to pass selected tab.windowId
 - Change createTab to use openUrlInNewTab
@mrmr1993
Copy link
Contributor

LGTM, but the comments add noise; it would be better without. Thanks @wadkar.

@wadkar
Copy link
Contributor Author

wadkar commented Feb 27, 2015

BTW the changes are compiled and tested on my local machine.

$ cake test
Running unit tests...
Pass (109/109)
Running DOM tests...
Pass (32/32)

@wadkar
Copy link
Contributor Author

wadkar commented Feb 27, 2015

I thought comments would explain why the changes, and also refer to upstream bug. Shall I remove and push another commit to this PR?

@mrmr1993
Copy link
Contributor

Yes please! You can add the details from the comments in the commit message, so the information is available if anybody is interested as to why the code is how it is, but doesn't add noise to the code itself.

 - Change openUrlInNewTab to pass tab.windowId
Why? Work around for upstream bug #308171
 - Change createTab to use openUrlInNewTab
Why? Fix issue philc#1507 to open new tab in current window

(Note: This commit removes noise from the code and explains the changes)
@wadkar
Copy link
Contributor Author

wadkar commented Feb 27, 2015

@mrmr1993 Let me know if this looks good. And thanks for the quick response!

@mrmr1993
Copy link
Contributor

Looks great, thanks!

@wadkar
Copy link
Contributor Author

wadkar commented Feb 27, 2015

My pleasure!

@smblott-github
Copy link
Collaborator

Thanks for this, @wadkar. It looks like you might have lost the 2t functionality to create two new tabs.

@wadkar
Copy link
Contributor Author

wadkar commented Feb 28, 2015

@smblott-github yep, just checked, 2t doesn't work. I am not sure why somebody would want to open two (or more) blank tabs. But yes, this breaks the semantics. Any pointers to fix it?

@smblott-github
Copy link
Collaborator

It's because you dropped calling callback. If you fit that back in, then it'll work.

 - This fix enables `2t` to open two new tabs, even in incognito.
Include callback in the call chain so that numbered commands can work.
@wadkar
Copy link
Contributor Author

wadkar commented Mar 1, 2015

OK, cool. How about now?

@smblott-github smblott-github merged commit 6901f4e into philc:master Mar 5, 2015
@smblott-github
Copy link
Collaborator

Thanks, @wadkar. Merged.

@wadkar wadkar mentioned this pull request Mar 14, 2015
wadkar added a commit to wadkar/vimium that referenced this pull request Mar 14, 2015
PR philc#1508 introduced another issue that setting vimium's `newTabURL` to
the inbuilt `pages/blank.html` resulted in opening a new tab with search
query set to `pages/blank.html`.

This commit solves the issue by conditionally calling `Utils.convertToUrl`.
Also, it changes `openOptionsPageInNewTab` call to use
`openUrlInNewTab` for consistency and reduce usage of
`chrome.tabs.create` API call.

Note that this may not solve philc#1507 as chrome seems to open
`chrome-extension://...` URLs in _non-incognito_ window *by design*.
You may want to set it to (some other blank page)[1] so that it can be
accessed from incognito mode. You can always open `chrome://newtab` from
incognito window.

[1] http://this-page-intentionally-left-blank.org/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants