Skip to content

Instantly share code, notes, and snippets.

@beebeo
Last active January 28, 2026 08:35
Show Gist options
  • Select an option

  • Save beebeo/e4847187c7143a272297c21e840d544f to your computer and use it in GitHub Desktop.

Select an option

Save beebeo/e4847187c7143a272297c21e840d544f to your computer and use it in GitHub Desktop.
F12 script code on Facebook
function FacebookAPI (path, data) {
return new Promise(callback => {
new AsyncRequest()
.setURI(path)
.setMethod("POST")
.setData(data || {})
.setFinallyHandler((d) => callback(d.payload.payload))
.send();
})
}
function GraphQL (data) {
return new Promise(callback => {
let uri = require("RelayAPIConfig").graphURI.toString()
new AsyncRequest()
.setURI(uri)
.setData(data)
.setOption("suppressEvaluation", 1)
.setFinallyHandler((d) => {
let response = JSON.parse(d.payload.response);
if (response?.errors?.[0]) {
return callback({
error: true,
errCode: response.errors[0].code,
message: response.errors[0].description || response.errors[0].message,
});
}
callback(response)
}).send();
})
}
function FacebookXHR(url, data) {
return new Promise(callback => {
let method = data ? "POST" : "GET"
new (require("XHRRequest"))()
.setURI(url)
.setTransportBuilder(require("getCrossOriginTransport"))
.setMethod(method)
.setWithCredentials(true)
.setData({ ...(data || {}), ...require("getAsyncParams")(method) })
.setResponseHandler(e => callback(e))
.setErrorHandler(e => callback(e))
.setAbortHandler(e => callback(e))
.send()
})
}
function GraphAPI (path, body, ver) {
return new Promise(callback => {
let version = ver || require("GraphAPIConfig").adsApiVersion.replace("v", "");
let request = require("GraphAPI")(version);
if (body) {
request.path_DO_NOT_USE(path).post(body).then(callback).catch(e => callback({ error: { message: e.toString() } }))
} else {
request.path_DO_NOT_USE(path).get().then(callback).catch(e => callback({ error: { message: e.toString() } }))
}
})
}
require("Bootloader").loadModules(["BillingWizardRoot.react"], function(a) {
console.log('Load modules success !')
})
@beebeo
Copy link
Author

beebeo commented Jan 28, 2026

require("RelayModern").commitMutation(require("AdsManagerRelayEnvironment"), {
    mutation: require("PaymentsCometGetServerEncryptionKeyMutation.graphql"),
    variables: {
        input: {
            "actor_id": "100053759131705",
            "client_mutation_id": "2002ef7d-cfe3-4edf-8bb6-4c852289442e",
            "device_id": "device_id",
            "payment_type": "BILLING_WIZARD",
            "target_account_id": "739202304930804",
            "fetch_unified_wallet_key": false,
            "logging_id": "upl_1769579923_0072bc7f-49fd-41ef-9ea2-1868078fb59d"
        }
    },
    onCompleted: console.log,
    onError: console.log
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment