mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 14:49:32 +00:00
Remove embedTweet.js, use <base target="_blank"> instead
This commit is contained in:
parent
fe8f482d5c
commit
ca19250a62
2 changed files with 5 additions and 34 deletions
|
|
@ -1,28 +0,0 @@
|
|||
// This runs after embedResize.js sets up the sendHeight function
|
||||
(function() {
|
||||
var sendHeight = window._nitterSendHeight;
|
||||
|
||||
// Make images load eagerly so height updates correctly
|
||||
var lazyImages = document.querySelectorAll('img[loading="lazy"]');
|
||||
for (var i = 0; i < lazyImages.length; i++) {
|
||||
lazyImages[i].loading = 'eager';
|
||||
}
|
||||
|
||||
// Update height when images finish loading (only if sendHeight available)
|
||||
if (sendHeight) {
|
||||
var allImages = document.querySelectorAll('img');
|
||||
for (var i = 0; i < allImages.length; i++) {
|
||||
var img = allImages[i];
|
||||
if (!img.complete) {
|
||||
img.addEventListener('load', sendHeight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Open all links in new tab (we're in an iframe)
|
||||
var allLinks = document.querySelectorAll('a');
|
||||
for (var i = 0; i < allLinks.length; i++) {
|
||||
allLinks[i].target = '_blank';
|
||||
}
|
||||
|
||||
})();
|
||||
Loading…
Reference in a new issue