Roaming Authenticator Everywhere

嘘のPasskey対応を真のPasskey対応にします

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name        Roaming Authenticator Everywhere
// @namespace   https://rokoucha.net
// @version     0.0.3
// @author      Rokoucha
// @description 嘘のPasskey対応を真のPasskey対応にします
// @license     MIT
// @match       https://account.edit.yahoo.co.jp/authdevice*
// @match       https://accounts.nintendo.com/passkey/register
// @match       https://accounts.pixiv.net/passkeys/*
// @match       https://id.moneyforward.com/*
// @match       https://my.konami.net/*/security/passkey/registration/*
// @match       https://my.konami.net/*/signin
// @match       https://jp.mercari.com/mypage/personal_info/passkeys
// @match       https://x.com/*
// @run-at      document-start
// ==/UserScript==

function hook() {
    const origCreate = navigator.credentials.create
    navigator.credentials.create = function (options) {
        console.log('create hooked')
        if (options) {
            delete options.publicKey.authenticatorSelection.authenticatorAttachment
        }
        return origCreate.apply(this, [options])
    }

    const origGet = navigator.credentials.get
    navigator.credentials.get = function (options) {
        console.log('get hooked')
        if (options && options.publicKey && options.publicKey.allowCredentials) {
            options.publicKey.allowCredentials = options.publicKey.allowCredentials.map((c) => {
                c.transports = ['ble', 'hybrid', 'internal', 'nfc', 'usb']
                return c
            })
        }
        return origGet.apply(this, [options])
    }
}

console.info("place a hook")
hook()