更新 2017.12.7 14:04閲覧 818

Opera 12 の feed の ads を消す方法

Opera のフィード配信に望まないコンテンツが表示されても、user.css や urlfilter.ini では非表示にできないので、/usr/share/opera/styles/webfeeds.html に分岐を追加する必要あり。
ビフォー

for( var i=0,feedEntry; feedEntry=feed.entries[i++]; ) { var itemLi = hItemsUl.lastChild.cloneNode( true ); // set the href itemLi.firstChild.firstChild.setAttribute( 'href', feedEntry.uri||'#' ); // set the title itemLi.firstChild.firstChild.firstChild.nodeValue = sanitize( feedEntry.title.data ).textContent.trim()||noTilteStr; // set the timestamp & author var txt = feedEntry.publicationDate.toLocaleString(); if( feedEntry.author ) { txt += '\n'+ feedEntry.author; } itemLi.firstChild.nextSibling.firstChild.nodeValue = txt; // sanitize content sanitize( (feedEntry.content.data.trim()||'\xa0'), itemLi.lastChild ); // append itemLi to hItemsUl hItemsUl.insertBefore( itemLi, hItemsUl.lastChild ); }
アフター

for( var i=0,feedEntry; feedEntry=feed.entries[i++]; ) { // added by HCQF if ( feedEntry.uri.indexOf('rssad') === -1 ) { var itemLi = hItemsUl.lastChild.cloneNode( true ); // set the href itemLi.firstChild.firstChild.setAttribute( 'href', feedEntry.uri||'#' ); // set the title itemLi.firstChild.firstChild.firstChild.nodeValue = sanitize( feedEntry.title.data ).textContent.trim()||noTilteStr; // set the timestamp & author var txt = feedEntry.publicationDate.toLocaleString(); if( feedEntry.author ) { txt += '\n'+ feedEntry.author; } itemLi.firstChild.nextSibling.firstChild.nodeValue = txt; // sanitize content sanitize( (feedEntry.content.data.trim()||'\xa0'), itemLi.lastChild ); // append itemLi to hItemsUl hItemsUl.insertBefore( itemLi, hItemsUl.lastChild ); } }

コメント

当フォームより収集される個人情報は、返信を要する際に使用されるものであり、法令に基づく行政機関等への提供を除き、ご本人の同意を得ずに第三者に提供することはありません。また、コメントが掲載される場合であってもメールアドレスが本サイト内に記載されることはありません。