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

Pass ATB param better #286

Merged
merged 5 commits into from Aug 28, 2018
Merged

Pass ATB param better #286

merged 5 commits into from Aug 28, 2018

Conversation

andrey-p
Copy link
Contributor

Reviewer: @jdorweiler
CC: @bsstoner

Description:

This gets the extension to pick up ATB param on install from the query string.

Steps to test this PR:

On FF/Chrome:

  1. Open a tab with a URL like: https://duckduckgo.com/?natb=v123-4ab
  2. Install the extension
  3. The ATB param will be v123-4ab.

Automated tests:

  • Unit tests
  • Integration tests
Reviewer Checklist:
  • Ensure the PR solves the problem
  • Review every line of code
  • Ensure the PR does no harm by testing the changes thoroughly
  • Get help if you're uncomfortable with any of the above!
  • Determine if there are any quick wins that improve the implementation
PR Author Checklist:
  • Get advice or leverage existing code
  • Agree on technical approach with reviewer (if the changes are nuanced)
  • Ensure that there is a testing strategy (and documented non-automated tests)
  • Ensure there is a documented monitoring strategy (if necessary)
  • Consider systems implications

@@ -9,9 +9,7 @@ const ATB = require('./atb.es6')
chrome.runtime.onInstalled.addListener(function (details) {
if (details.reason.match(/install/)) {
ATB.updateATBValues()

// need to wait a bit for ATB to be set
setTimeout(() => ATB.openPostInstallPage(), 2000)
Copy link
Contributor Author

@andrey-p andrey-p Aug 28, 2018

Choose a reason for hiding this comment

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

Nice that this timeout could be removed now that we definitely know when ATB param is retrieved.

})
}

resolve(tabs.map(tab => tab.url))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm just passing the URLs from here, then reading them back from within the ATB module. That way it's easier to add tests.

})
let getDDGTabUrls = () => {
// we don't currently support getting ATB from install page on Safari
return Promise.resolve([])
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It shouldn't be too difficult to actually return URLs from here, but I guess it's not a codepath we actually care about if Safari only does gallery installs now.

@jdorweiler
Copy link
Contributor

👍

@jdorweiler jdorweiler merged commit 7e6ad0b into develop Aug 28, 2018
@jdorweiler jdorweiler deleted the andrey/easier-atb-pass branch August 28, 2018 20:16
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

2 participants