Last active
November 23, 2025 17:00
-
-
Save beebeo/e4847187c7143a272297c21e840d544f to your computer and use it in GitHub Desktop.
F12 script code on Facebook
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function FacebookAPI (path, data) { | |
| return new Promise(callback => { | |
| new AsyncRequest() | |
| .setURI(path) | |
| .setMethod("POST") | |
| .setData(data || {}) | |
| .setFinallyHandler((d) => callback(d.payload.payload)) | |
| .send(); | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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() } })) | |
| } | |
| }) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("Bootloader").loadModules(["BillingWizardRoot.react"], function(a) { | |
| console.log('Load modules success !') | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment