这很容易用JavaScript实现。将此放置在页面底部,就在</body>
标签
这将附加?pp=my-affiliate-id
在链接的末尾。只需更改变量aid
以下值:
<script>
// Change "my-affiliate-id" below to your actual affiliate id
const aid = \'my-affiliate-id\';
// Append slash with affiliate id, only if an affiliate ID is not found in the link yet
const goglinks = document.querySelectorAll(\'a[href*="gog.com"]\');
goglinks.forEach(function(el) {
if(!el.href.includes(\'pp=\')) {
el.href = el.href.replace(/\\?.*$/, \'\') + \'?pp=\' + aid
}
})
</script>
Demo: https://jsfiddle.net/samliew/ks3y8059