stephenou / fruitionsite

Build your website with Notion for free
https://fruitionsite.com
MIT License
1.6k stars 223 forks source link

Is there any way to prevent "client-production" requests? #64

Open notbotman opened 3 years ago

notbotman commented 3 years ago

Is there any way to prevent "client-production" requests?

Seems like all the errors will be logged into Notion Internal tool like sentry, this might overwhelm the staffs

And also it can reduce network requests.

image

osbre commented 3 years ago

Possibly it can be solved by replacing some specific part in the JS file.

osbre commented 3 years ago

Looks like I found the part which is responsible for this:

JS code screenshot

osbre commented 3 years ago

And here is the solution

Script need to replace this:

c.prototype.backoff=function('

to this:

c.prototype.backoff=function() {}, c.prototype.somet=function(

notbotman commented 3 years ago

Nice thanks @osbre I'll give a shot now!

notbotman commented 3 years ago

But @osbre where I need to change in worker script?

osbre commented 3 years ago

I'm not sure, because I tested it using Nginx

But, looks like the replacement is possible here:

https://github.com/stephenou/fruitionsite/blob/master/worker.js#L103

(you can add another .replace(...))

notbotman commented 3 years ago

@osbre I can't figure out, it didn't work for me 😞

osbre commented 3 years ago

Note : Probably it blocks only most of them. Need to find where other requests coming from, via chrome devtools. And then replace this part with the similar syntax I'll check it later.