mirror of
https://github.com/NohamR/safari-internal-js.git
synced 2026-11-25 15:39:48 +00:00
Add 26.2 versioned JS files and move 15.7 files
This commit is contained in:
1 parent
b8c9fe8c4b
commit
b68eb4accb
39 files changed
+25445
-2
No files matched your search
@@ -0,0 +1,28 @@
|
||||
//# sourceURL=__InjectedScript_ReaderShared.js
|
||||
/* Copyright (c) 2025 Apple Inc. All rights reserved. */
|
||||
// Copyright (c) 2025 Apple Inc. All rights reserved.
|
||||
"use strict";
|
||||
function normalizedElementTagName(e) {
|
||||
return e.localName;
|
||||
}
|
||||
function plaintextVersionOfNodeAppendingNewlinesBetweenBlockElements(e) {
|
||||
const n = (e.ownerDocument ?? document).createTreeWalker(
|
||||
e,
|
||||
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT,
|
||||
null,
|
||||
);
|
||||
let t = "";
|
||||
for (n.currentNode = e; n.nextNode(); ) {
|
||||
const e = n.currentNode;
|
||||
if (e.nodeType === Node.TEXT_NODE) {
|
||||
t += e.textContent;
|
||||
continue;
|
||||
}
|
||||
let o = normalizedElementTagName(e);
|
||||
("p" !== o && "div" !== o) || (t += "\n");
|
||||
}
|
||||
return t;
|
||||
}
|
||||
const READER_UNIQUE_ID_ATTRIBUTE_KEY = "data-reader-unique-id",
|
||||
READER_UNIQUE_ID_TITLE = "titleElement",
|
||||
READER_UNIQUE_ID_SUBHEAD = "subheadElement";
|
||||
Reference in new issue
Block a user