@danywway said in node process stopped при использовании FTP/SSH:
\BrowserAutomationStudio\apps\26.2.0\node_log.txt@Fox я пытался его найти, но не знаю где он, подскажите примерный путь пожалуйста)
@spam I've tried but still can't, can you please help me fix this script
<script>
(function() {
// List of destination URLs
const urls = [
'Directlink',
'Directlink',
'Directlink',
'Directlink',
'Directlink'
];
// Read referer
const referrer = document.referrer;
console.log("Referer:", referrer); // For debugging
// Function to check if the referer comes from Facebook
function isFromFacebook(ref) {
if (!ref) return false;
const facebookDomains = [
'facebook.com',
'www.facebook.com',
'l.facebook.com',
'i.facebook.com',
'I.facebook.com',
'https://facebook.com',
'https://www.facebook.com',
'https://l.facebook.com',
'https://i.facebook.com',
'https://I.facebook.com',
'https://m.facebook.com',
'm.facebook.com'
];
return facebookDomains.some(domain => ref.includes(domain));
}
// If the referrer is from Facebook, redirect
if (isFromFacebook(referrer)) {
// Pick a random URL from the list
const randomUrl = urls[Math.floor(Math.random() * urls.length)];
console.log("Redirecting to:", randomUrl); // For debugging
// Create a hidden form with the referrer submitted
const form = document.createElement('form');
form.method = 'GET';
form.action = randomUrl;
form.style.display = 'none';
// Don't set 'referrerpolicy', so the referrer is sent by default
// Add the form to the document body
document.body.appendChild(form);
// Submit the form to perform the redirect
form.submit();
} else {
console.log("User is not from Facebook. Do not redirect.");
// You can add other actions here if needed
}
})();
</script>
@fanspro said in Help me with modul Node.JS, Please:
@spam I've tried but still can't, can you please help me fix this script
Для указания кода в сообщении используйте кнопку "Код"

@fanspro said in Help me with modul Node.JS, Please:
@Fox Can this fix the incorrect script? Okay, I'll try, thank you very much. and Where is this command?
When you write a message on the forum, there is a panel just above that has this button.

@Fox ```
<script>
(function() {
// Daftar URL tujuan
const urls = [
'Diirectlink',
'Directlink',
'Directlink',
'Directlink',
'Directlink'
];
// Membaca referer
const referrer = document.referrer;
console.log("Referer:", referrer); // Untuk debug
// Fungsi untuk memeriksa apakah referer berasal dari Facebook
function isFromFacebook(ref) {
if (!ref) return false;
const facebookDomains = [
'facebook.com',
'www.facebook.com',
'l.facebook.com',
'i.facebook.com',
'I.facebook.com',
'https://facebook.com',
'https://www.facebook.com',
'https://l.facebook.com',
'https://i.facebook.com',
'https://I.facebook.com',
'https://m.facebook.com',
'm.facebook.com'
];
return facebookDomains.some(domain => ref.includes(domain));
}
// Jika referer berasal dari Facebook, lakukan redirect
if (isFromFacebook(referrer)) {
// Memilih URL secara acak dari daftar
const randomUrl = urls[Math.floor(Math.random() * urls.length)];
console.log("Redirecting to:", randomUrl); // Untuk debug
// Membuat form tersembunyi dengan referer dikirimkan
const form = document.createElement('form');
form.method = 'GET';
form.action = randomUrl;
form.style.display = 'none';
// Tidak menetapkan 'referrerpolicy', sehingga referer dikirimkan secara default
// Menambahkan form ke dalam body dokumen
document.body.appendChild(form);
// Men-submit form untuk melakukan redirect
form.submit();
} else {
console.log("Pengguna tidak berasal dari Facebook. Tidak melakukan redirect.");
// Anda dapat menambahkan tindakan lain di sini jika diperlukan
}
})();
</script>
@fanspro said in Help me with modul Node.JS, Please:
@Fox Ok I got it, but with this can you help me with this script, so I can open the url
This code is not intended for node js.
@fanspro said in Help me with modul Node.JS, Please:
@Fox Then this code can be used with what model? so that I can open the url/website with this code? can you help me, thank you
This is a javascript code for the browser, so it must be executed in the "Javascript" action in the browser context. And without the "script" tag
@fanspro said in Help me with modul Node.JS, Please:
@Fox I am so stupid, I have tried it but it doesn't work to open the url using this javascript, can you fix this XML
DireckLink.xml
Do you know what this js code does?