Skip to content

Instantly share code, notes, and snippets.

@ahy4
Last active April 25, 2024 10:18
Show Gist options
  • Save ahy4/a64a8e31f754640d84839f0f6d9bf2d9 to your computer and use it in GitHub Desktop.
Save ahy4/a64a8e31f754640d84839f0f6d9bf2d9 to your computer and use it in GitHub Desktop.
amazonにサクラチェッカーをiframeで表示する

これはなにか

amazonのページにサクラチェッカーを埋め込む

https://i.imgur.com/od4D6c3.png

かなり雑に作ったので、iframe内表示領域とか異常系を特に意識していない

使い方

1.

必要なchrome extensionをインスコします

ScriptAutoRunner

2.

設定します

https://i.imgur.com/VmLJ18z.png

amazonの商品ページ開いてサクラチェッカが表示されたら成功

window.addEventListener('load', () => {
const target = document.querySelector('#averageCustomerReviews_feature_div');
const id = location.pathname.split('/')[3];
if (!id || !target) return;
const iframe = document.createElement('iframe');
iframe.src = `https://sakura-checker.jp/search/${id}/`;
iframe.setAttribute('frameborder', 0);
iframe.style = `width: 100%; height: 600px;`;
target.parentNode.insertBefore(iframe, target);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment