Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

X Frame Bypass not working at all. #42

Open
6306 opened this issue Oct 1, 2021 · 7 comments
Open

X Frame Bypass not working at all. #42

6306 opened this issue Oct 1, 2021 · 7 comments

Comments

@6306
Copy link

6306 commented Oct 1, 2021

This is not working at all. I was using this to make a web browser for AaronOS. Failed to access any websites that restricts iFrames

@stretch07
Copy link

@6306 any luck on the browser? aaronos is cool

@6306 6306 changed the title X Frane Bypass not working at all. X Frame Bypass not working at all. Feb 16, 2022
@6306
Copy link
Author

6306 commented Feb 16, 2022

@its-pablo
I got the XFrame Bypass working even though it's slow.
Now I have to code the browser part. I'll tell you more when I'm finished.

@1UC1F3R616
Copy link

@6306 mind sharing how, it's over a month now :D

@6306
Copy link
Author

6306 commented Mar 28, 2022

Not that much of luck on the web browser in html. Can't get it to render the new URL in the textbox to render on the XFrame Bypass.

@JWriter20
Copy link

@its-pablo I got the XFrame Bypass working even though it's slow. Now I have to code the browser part. I'll tell you more when I'm finished.

What did you do to fix it?

@syonfox
Copy link

syonfox commented Nov 30, 2023

just curios with cloudflare these days could we use a cors proxy simaler to how im downloading git repost in the browser

Coudflare pages cors proxy
async function handleProxyRequest(request) {

    const url = getUrlParam(request)
    console.log(`${request.method} ${url}`)

    if (!url) {
        return new Response(
            Page, // or html
            {
                headers: { "Content-Type": "text/html" },
                status: 404,
            }
        )
    } // We done if no url were not a proxy we are a alanding page

    let headers = Object.fromEntries(request.headers.entries());

    console.log("Headers: ", JSON.stringify(headers, null, 2))
    let response = await fetch(new Request(url, {
        body: request.body,
        headers: request.headers,
        method: request.method,
        redirect: "follow",
    }))
    let { readable, writable } = new TransformStream()
    response.body.pipeTo(writable)
    return new Response(
        readable,
        {
            headers: response.headers,
            status: response.status,
        }
    )
}

//FUNCTION: Extract pathname and searchParams from the request URL
function getUrlParam(request) {

    const { pathname, searchParams } = new URL(request.url);
    if (pathname.startsWith("/http")) {
        //Modify the pathname by replacing "http:/" or "https:/" with "http://" or "https://"

        return pathname
            .slice(1) // Remove the leading "/"
            .replace(/http:\/(?!\/)/, "http://") // Replace "http:/" with "http://"
            .replace(/https:\/(?!\/)/, "https://"); // Replace "https:/" with "https://"
    }
    // Check if there's a "url" parameter in the searchParams, and if it starts with "http"
    const searchParamsUrl = searchParams.get("url");
    if (searchParamsUrl?.startsWith("http")) {
        // Return the value of the "url" parameter
        return searchParamsUrl;
    }
    // If none of the conditions are met, the function returns undefined
}



export async function onRequest(c){

    return handleProxyRequest(c.request).catch(
        (err) => new Response(err.stack, { status: 500 })
    )
}

@ShaneOss
Copy link

just curios with cloudflare these days could we use a cors proxy simaler to how im downloading git repost in the browser
Coudflare pages cors proxy

#51 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants