Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove flash fix #1258

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions js/hoverzoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@ var hoverZoom = {
}`;
document.head.appendChild(styleBlink);

var flashFixDomains = [
'www.redditmedia.com'
];

// calculate optimal viewer position and size
function posViewer(position) {

Expand Down Expand Up @@ -2323,8 +2319,6 @@ var hoverZoom = {
prepareImgLinksAsync();
}
bindJsaction();
} else if (insertedNode.nodeName === 'EMBED' || insertedNode.nodeName === 'OBJECT') {
fixFlash();
}
}

Expand Down Expand Up @@ -2664,40 +2658,6 @@ var hoverZoom = {
}
}

// TODO: Flash is basically dead. Should this be deleted?
function fixFlash() {
if (flashFixDomains.indexOf(location.host) === -1) {
return;
}
if (isExcludedSite() || window == window.top && $('.hoverZoomLink').length == 0) {
return;
}
$('embed:not([wmode]), embed[wmode="window"]').each(function () {
if (!this.type || this.type.toLowerCase() != 'application/x-shockwave-flash') {
return;
}
var embed = this.cloneNode(true);
embed.setAttribute('wmode', 'opaque');
unbindObserver();
$(this).replaceWith(embed);
bindObserver();
});
var wmodeFilter = function () {
return this.name.toLowerCase() == 'wmode';
};
$('object[type="application/x-shockwave-flash"]').filter(function () {
var param = $(this).children('param').filter(wmodeFilter);
return param.length == 0 || param.attr('value').toLowerCase() == 'window';
}).each(function () {
var object = this.cloneNode(true);
$(object).children('param').filter(wmodeFilter).remove();
$('<param name="wmode" value="opaque">').appendTo(object);
unbindObserver();
$(this).replaceWith(object);
bindObserver();
});
}

function getExtensionFromUrl(url, video, playlist, audio) {
let fullurl = url;
// remove trailing / & trailing query
Expand Down Expand Up @@ -3528,7 +3488,6 @@ var hoverZoom = {
hz.pageGenerator = $('meta[name="generator"]').attr('content');
prepareImgLinks();
bindEvents();
fixFlash();

debug = options.debug;
}
Expand Down