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

extension: another speculative fix for getCurrentTabURL; more logging #5323

Merged
merged 1 commit into from
May 23, 2018

Conversation

brendankenny
Copy link
Member

@brendankenny brendankenny commented May 23, 2018

Speculative fix for "getCurrentTabURL returned empty string".

Uses Patrick's idea to pick the first tab with a URL. Unclear if there will actually be a tab with a url (maybe there are no other tabs provided since we ask only for the active tabs in the current window) but it won't hurt the current correct cases where the first tab has a URL.

In addition, added more detailed error messages that may give us some hints for what's going on

  • log what URL is provided to runner that fails the first URL exists check (Extension Error: You must provide a url to the runner #1834)
  • log the number of tabs found and their IDs if no tab with a URL is found (the ID might help if it's chrome.tabs.TAB_ID_NONE, which is set for "for apps and devtools windows)). I don't see anything else in that property list that leaps out as helping to debug, but happy to add others.

Copy link
Collaborator

@patrickhulce patrickhulce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice let's give it a shot!

}
if (tabs.length > 1) {
log.warn('ExtensionConnection', '_queryCurrentTab returned multiple tabs');
}
resolve(tabs[0]);

const firstUrledTab = tabs.find(tab => !!tab.url);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, firstUrledTab :)

Copy link
Member

@paulirish paulirish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets give it a go

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.

3 participants