https://www.photoshelter.com/search/ の結果から…
- User
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
以下は、https://www.photoshelter.com/search/ の結果ページから https://www.photoshelter.com/img/pixel.gif を抑制する Userscript です。このスクリプトは、ページ読み込み時に自動的にトラッキングピクセルを削除し、必要に応じて動的なコンテンツの変更にも対応します。
// ==UserScript==
// @name PhotoShelter Pixel GIF Blocker
// @namespace https://tampermonkey.net/
// @version 0.1
// @description Suppresses the PhotoShelter tracking pixel GIF on search result pages.
// @author You
// @match https://www.photoshelter.com/search/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
// トラッキングピクセルのURL
const pixelUrl = 'https://www.photoshelter.com/img/pixel.gif';
// 既存のピクセルを削除する関数
function removePixelGifs() {
const images = document.querySelectorAll(`img[src="${pixelUrl}"]`);
images.forEach(img => img.remove());
}
// 初期読み込み時にピクセルを削除
removePixelGifs();
// MutationObserverを使用して動的なコンテンツ変更を監視
const observer = new MutationObserver(mutations => {
mutations.forEach(() => {
removePixelGifs();
});
});
// ページ全体を監視対象とする
observer.observe(document.body, {
childList: true,
subtree: true
});
})();
メタデータ:
@name, @namespace, @version, @description, @author, @match はスクリプトの基本情報です。@match は https://www.photoshelter.com/search/* に一致するページでスクリプトを実行します。トラッキングピクセルのURL:
const pixelUrl でターゲットのピクセルURLを定義しています。ピクセル削除関数:
removePixelGifs() 関数は、指定されたURLの img タグをすべて検索し、削除します。初期実行:
removePixelGifs() を呼び出して既存のピクセルを削除します。MutationObserver:
MutationObserver を使用しています。childList: true と subtree: true で、ページ全体の子要素の追加を監視します。removePixelGifs() を再度呼び出して新しいピクセルを削除します。Userscriptマネージャーのインストール:
スクリプトの追加:
有効化:
https://www.photoshelter.com/search/ にアクセスします。これで、PhotoShelterの検索結果ページからトラッキングピクセルが削除されます。