niutech / x-frame-bypass

Web Component extending IFrame to bypass X-Frame-Options: deny/sameorigin
https://niutech.github.io/x-frame-bypass/
Apache License 2.0
669 stars 267 forks source link

X Frame Bypass not working at all. #42

Open 6306 opened 2 years ago

6306 commented 2 years ago

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 commented 2 years ago

@6306 any luck on the browser? aaronos is cool

6306 commented 2 years ago

@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 commented 2 years ago

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

6306 commented 2 years ago

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 commented 2 years ago

@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 commented 9 months ago

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 ```js 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 commented 9 months ago

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

https://github.com/niutech/x-frame-bypass/issues/51#issuecomment-1430541704