const STYLES_AMAZON_PAY = ` .amazonpay-button-view3 {display: none;} .amazonpay-button-view1 {background: #eee; border: 1px solid #eee; border-radius: 4px;} .amazonpay-button-view1-ink:hover {background: #eee;} .amazonpay-button-chevrons {display:none;} @media only screen and (min-width: 75px) {.amazonpay-button-view1 {height: 25px !important;}} @media only screen and (min-width: 150px){.amazonpay-button-view1 {height: 25px !important;}} @media only screen and (min-width: 200px){.amazonpay-button-view1 {height: 35px !important;}} @media only screen and (min-width: 300px){.amazonpay-button-view1 {height: 45px !important;}} `; function modifyAmazonPayButton(){ setInterval(function(){ const allButtons = document.querySelectorAll('.amazon-pay-button-wrapper'); if(allButtons.length > 0){ allButtons.forEach(function(buttonContainer){ const button = buttonContainer.querySelector('[id^="amazon"]'); if(button) { if(button.shadowRoot.querySelector('#custom-button-style')) return; const style = document.createElement('style'); style.innerHTML = STYLES_AMAZON_PAY; style.id = 'custom-button-style'; button.shadowRoot.appendChild(style); } }); } }, 200); } modifyAmazonPayButton();