URL as appears: https://www.ebay.com/itm/[item id]?mkevt=1&mkcid=1&mkrid=711-53200-19255-0&campid=[affiliate id]&toolid=1001
Feature has been removed
The theme component will replace /itm/ /usr/ and /str/ URLs.
Additionally, links appearing in the “Popular Links” section will also be replaced and disclosed when applicable.
Disclosure is an important legal requirement. An attempt was made to make disclosures as obvious as possible but there are no legal guarantees. For more information and specifics visit here: Affiliate disclosure FAQ | eBay Partner Network
Makes sense as theme-components are very similar to Tamper Monkey Scripts.
On the really cool side your work here could be used as a non plugin work around for a Hosted plan that does not include the (Amazon)Affiliates Plugin.
I imagine you could also add a user or group check to not modify link. Ie you support YouTubers and do not want their affiliates links modified. Maybe added as an optional setting?
I am wondering though as the Affiliates Plugin does not provide the disclaimer that the link was modified. Would the plugin then be violating laws depending on the region the site is in?
Interesting so your component here has greater compliance than the Affiliates Plugin. Your work though could be modified(forked) to be a complimentary component that corrects the compliance miss. As the plugin does modify those short share links.
I’ve written this code to meet my own needs and I’m glad to share it, following the open-source ethos of Discourse. This applies for most plugins and theme components I’ve written. Anyone can feel free to build on or change it.
But I don’t use the Amazon affiliate plugin. I’m all for sharing what I create for myself, but taking on extra work to extend and maintain a separate plugin would need some incentive, be it financial or otherwise.
Imho the native plugin has the problem that it gets fished out by every average script oder ad blocker plugin or even Pi-hole. So this plugin/component should work a lot better!
I did not install it, yet. Waiting for a “real” theme component through Github. I know, this needs some extra work for the settings which get inserted into the code, which now is done by the user. But by creating a component does not cover updates…