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

Add periodic tracking and periodic validation for payment pointers #84

Merged

Conversation

vezwork
Copy link
Member

@vezwork vezwork commented Nov 19, 2020

Related Issues

Closes #17
I expect that this PR also fixes (#76), but that needs to be verified.

Summary of Changes

  • adds some logic in a setinterval which repeatedly checks if there is a new payment pointer on the current page.
  • adds a listener to the visibilitychange which updates the browser extension icon to the correct state when switching between tabs.
  • adds a validationTimestamp field to the AkitaPaymentPointerData class to facilitate verifying if a payment pointer was validated recently.

Explanation of Added Features

Tracking and validating payment pointer if it changes on the current page

If a new payment pointer is encountered on the page and it has not been validated recently then it will be validated. If the validation is successful or if the payment pointer was already validated recently, the browser extension icon is set to the monetized state, otherwise it is set to the un-monetized state.

Setting extension icon correctly when switching between tabs

When switching between tabs, the payment pointer on the new tab is validated if it has not been validated recently. If the validation is successful or if the payment pointer was already validated recently, the browser extension icon is set to the monetized state, otherwise it is set to the un-monetized state.

Also note that payment pointers are no longer stored in browser storage if they fail validation.

@vezwork vezwork linked an issue Nov 19, 2020 that may be closed by this pull request
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from 04c71c8 to e17af7f Compare November 19, 2020 23:51
@sharon-wang sharon-wang changed the title Add periodic tracking and periodic validation for payment pointers. Add periodic tracking and periodic validation for payment pointers Nov 20, 2020
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from e17af7f to a2db1fa Compare November 20, 2020 02:02
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from a2db1fa to 12545f5 Compare November 20, 2020 03:08
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from 12545f5 to 0dcfd2e Compare November 20, 2020 03:14
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
src/content_main.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from 0dcfd2e to ed8bb39 Compare November 20, 2020 03:28
src/content_main.js Outdated Show resolved Hide resolved
@vezwork vezwork force-pushed the repeatedly_check_payment_pointer branch from ed8bb39 to 646f7ef Compare November 20, 2020 03:41
@sharon-wang
Copy link
Member

Tested these changes to see if #76 would be resolved, but it's still reproducible.

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.

Repeatedly check if payment pointer in monetization tag has changed
2 participants