webdevnerdstuff / amazon-smile-redirect

This Extension will automatically redirect you to the corresponding AmazonSmile page, so you will never need to remember to go to AmazonSmile first. In order for your non-profit to benefit from your purchase, you must complete your purchase through AmazonSmile.
GNU General Public License v3.0
72 stars 5 forks source link

Redirects to Smile for amazon.de even when not logged in #80

Closed PhoenixIV closed 2 years ago

PhoenixIV commented 2 years ago

With this plugin I get redirected to Amazon Smile for .de even if I am not logged in.

Screenshots https://youtu.be/yehLPsq5ZlQ

Additional context Thank you for inviting me to report this bug over in the Firefox addons comment section.

I found no reason for this issue in your code. Here are the first three nav-line-1 classes in order:

                <span class="nav-line-1 nav-progressive-content" id="glow-ingress-line1">
                   Hallo
                </span>

      <span class="nav-line-1">
      </span>

<span id="nav-link-accountList-nav-line-1" class="nav-line-1 nav-progressive-content">Hallo, Anmelden</span>

I do not understand why you do not use span id="nav-link-accountList-nav-line-1"

Consider https://github.com/Aaron-P/SmartAmazonSmile, it uses Cookies to determine a session and it therefore reacts instantly before site content is even loaded.

And thanks for your work.

Desktop (please complete the following information): Firefox 94.0.2 (64-Bit) Extension Version 2.1.2

webdevnerdstuff commented 2 years ago

Thank you for coming over here to give some more information. It is actually very helpful.

The plugin is supposed to go to the login page if you are not logged in. You have to be logged in before you can load the AmazonSmile page, or it will redirect you back to the regular site. Which would cause an endless redirect loop. So that functionality is working as it should. To stop it a user can just turn off the extension via the Extension icon menu.

What I find very useful though is how the other Extension uses Cookies to determine the session. I looked into checking cookies years ago, but wasn't sure what Amazon was setting, and since the Extension worked I kind of forgot about it. Using cookies might be something to deter users from installing the extension, and it might require updating the extension permissions. To be honest, I'm not positive off the top of my head, so I'll have to look into that more. I've never really liked how I checked if the user was logged in, so I do find this approach interesting.

When I have some more time I'll definitely be looking into this more as it's something I have wanted in the past. So thank you for sharing that other Extension. I'd have to figure out my own way of doing it as I don't want to just copy code from another developer.

I would ask you reconsider the rating you gave the Extension, as it is actually working as intended.

PhoenixIV commented 2 years ago

I much prefer the behaviour of "Smart Amazon Smile". "Amazon Smile Redirect" forces me to log in to Amazon, which is completely unnecessary and privacy-unfriendly. I only ever need Smile when I want to click "order now", and that I only do after logging in.

The plugin is supposed to go to the login page if you are not logged in.

What does "This extension considers if you are logged in" mean?

If it is supposed to always go to the login page, then there is no need to write code for it, as just redirecting any site to smile will automatically trigger a log in by amazon if necessary. I consider the statement "considers if you are logged in" only as valuable in the context of "only redirects you to smile when you are logged in".

webdevnerdstuff commented 2 years ago

Next release I plan on adding a new setting for the user to choose if the extension should redirect when logged off or only when logged in.

webdevnerdstuff commented 2 years ago

@PhoenixIV I opened a discussion for adding this as a new feature. I'd like to get your thoughts about it if you have any specific ideas about it.

Discussion: https://github.com/webdevnerdstuff/amazon-smile-redirect/discussions/81

webdevnerdstuff commented 2 years ago

@PhoenixIV I think I might almost be done adding this new feature. I still need to do some more QA testing, as well as update all the translation files before it can be published. Let me know what you think. I'm still not 100% on the verbiage for the setting. Feedback would be appreciated in the discussion page.

Discussion

Here's the updated code. I did some restructuring of my files, so it'll be a bit different from the master branch. https://github.com/webdevnerdstuff/amazon-smile-redirect/tree/discussion-81

webdevnerdstuff commented 2 years ago

I just released version 2.2.0, which now has the ability to set an option to only redirect when logged in.

I hope you will now reconsider your rating @PhoenixIV ;)

PhoenixIV commented 2 years ago

Oh boy. I have not even tested this out but I am sure this deserves deleting my rating 😀

webdevnerdstuff commented 2 years ago

Thank you. Hopefully this new feature is what you were looking for, and others will find it useful as well. :)