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

View File

@@ -0,0 +1,43 @@
//# sourceURL=__InjectedScript_AutomaticPasswords.js
/* Copyright (c) 2025 Apple Inc. All rights reserved. */
((FormMetadata.prototype._collectExtraControlMetadata = function (t, o) {
let e = t.getAttribute("passwordrules");
o.ControlPasswordRules = e || void 0;
}),
(FormMetadata.prototype.removeAutomaticStrongPasswordFromPasswordElement =
function (t) {
let o = this.formControlWithUniqueID(t);
o &&
this._isTextField(o) &&
(this.clearField(t),
this._updateAnnotationsForField(o),
FormMetadataJSController.setInputElementAutofilled(o, !1));
}));
let AutomaticPasswords = function () {};
AutomaticPasswords.prototype = {
removeAutomaticPasswordElements: function (t, o, e) {
for (let o of t)
FormMetadataJS.removeAutomaticStrongPasswordFromPasswordElement(o);
if (!e) return;
let r = document.activeElement,
a = o ? FormMetadataJS.formControlWithUniqueID(o) : null;
(a && a.blur(), a && a === r && a.focus());
},
blurControlWithID: function (t) {
let o = t ? FormMetadataJS.formControlWithUniqueID(t) : null;
o && o.blur();
},
setStrongPasswordElementViewableIfAppropriate: function (t, o) {
for (let e of t) {
let t = FormMetadataJS.formControlWithUniqueID(e);
if (!t) return;
if ("text" === t.type)
return (
FormMetadataJSController.setInputElementAutoFilledAndViewable(t, !1),
void FormMetadataJSController.setInputElementAutofilled(t, !1)
);
FormMetadataJSController.setInputElementAutoFilledAndViewable(t, o);
}
},
};
var AutomaticPasswordsJS = new AutomaticPasswords();