Add Safari internal JS services and documentation

This commit is contained in:
√(noham)²
2026-01-17 13:12:26 +01:00
commit 750f1a766d
17 changed files with 14397 additions and 0 deletions

35
js/reader/Reader.js Normal file
View File

@@ -0,0 +1,35 @@
//# sourceURL=__InjectedScript_Reader.js
/* Copyright (c) 2025 Apple Inc. All rights reserved. */
/*
* Copyright (c) 2010 Apple Inc. All rights reserved.
*/
function setScrollTop(e) {
document.documentElement.scrollTop = e;
}
function readerWillBecomeVisible() {
setReaderIsActive(!0);
}
function readerWillEnterBackground() {
setReaderIsActive(!1);
}
ReaderJS._clickingOutsideOfPaperRectangleDismissesReader = !0;
let cachedIframeURLMap = new Map();
((ReaderJS._readerWillBecomeVisible = function () {
for (let e of document.querySelectorAll("iframe")) {
let r = cachedIframeURLMap.get(e);
r && ((e.src = r), cachedIframeURLMap.delete(e));
}
}),
(ReaderJS._readerWillEnterBackground = function () {
for (let e of document.querySelectorAll("iframe")) {
e.src && (cachedIframeURLMap.set(e, e.src), e.removeAttribute("src"));
}
}),
(ReaderJS._isJavaScriptEnabled = function () {
return !!(ReaderJSController.initialConfiguration() || {})[
ReaderConfigurationJavaScriptEnabledKey
];
}),
(ReaderAppearanceJS._tryApplyStaticConfiguration = function () {
return (document.body.classList.add("mac"), !1);
}));

File diff suppressed because it is too large Load Diff

2419
js/reader/ReaderSharedUI.js Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
//# sourceURL=__InjectedScript_ReaderSharedUINormalWorld.js
/* Copyright (c) 2025 Apple Inc. All rights reserved. */
function loadTwitterJavaScript() {
window.twttr ||
(window.twttr = (function (e, t, r) {
var i,
a,
d = e.getElementsByTagName(t)[0];
if (!e.getElementById(r))
return (
((a = e.createElement(t)).id = r),
(a.src = "https://platform.twitter.com/widgets.js"),
d.parentNode.insertBefore(a, d),
window.twttr ||
(i = {
_e: [],
ready: function (e) {
i._e.push(e);
},
})
);
})(document, "script", "twitter-wjs"));
}
function richTweetWasCreatedFromSimpleTweet(e) {
e.parentNode.querySelector(".simple-tweet").classList.add("hidden");
}
function replaceSimpleTweetsWithRichTweets(e) {
let t = document.querySelectorAll("[data-reader-tweet-id]");
t.length &&
(loadTwitterJavaScript(),
twttr.ready(function (r) {
for (let i of t)
r.widgets
.createTweet(i.getAttribute("data-reader-tweet-id"), i, e)
.then(richTweetWasCreatedFromSimpleTweet);
}));
}