GithubHelp home page GithubHelp logo

custom scheme about penguloader HOT 8 CLOSED

VanillaMaster avatar VanillaMaster commented on June 11, 2024
custom scheme

from penguloader.

Comments (8)

nomi-san avatar nomi-san commented on June 11, 2024

LCU responds with header Referrer Policy: strict-origin-when-cross-origin.
Then all cross-orgin and cross-scheme (https -> pengu://) requests will be blocked.
Since Chromium v87, there's no way to bypass CORS policy, disabling whole web security is not a good idea.

from penguloader.

VanillaMaster avatar VanillaMaster commented on June 11, 2024

@nomi-san as far as i can see, it manageable

virtual bool AddCustomScheme(const CefString& scheme_name, int options) = 0;

CEF_SCHEME_OPTION_CORS_ENABLED = 1 << 4

from penguloader.

nomi-san avatar nomi-san commented on June 11, 2024

Yesh, this method allows cross-scheme import, but cant bypass resource requests.
Also tried CefAddCrossOriginWhitelistEntry().

// This function cannot be used to bypass the restrictions on local or display
// isolated schemes. See the comments on CefRegisterCustomScheme for more
// information.

from penguloader.

VanillaMaster avatar VanillaMaster commented on June 11, 2024

@nomi-san it definitely can, i playing around and now at the point where i just not good enough to implement cef_resource_handler_t and i just get crashes, but request doesnt get blocked by cors

https://gist.github.com/VanillaMaster/74392111ffcdb5c31a2b005610c2e7e9

from penguloader.

nomi-san avatar nomi-san commented on June 11, 2024

Fetch API should not work on non HTTP scheme, even with CEF_SCHEME_OPTION_FETCH_ENABLED.

from penguloader.

VanillaMaster avatar VanillaMaster commented on June 11, 2024

but esm imports works fine

from penguloader.

VanillaMaster avatar VanillaMaster commented on June 11, 2024

Fetch API should not work on non HTTP scheme, even with CEF_SCHEME_OPTION_FETCH_ENABLED.

then whats the point of thet option ...

from penguloader.

nomi-san avatar nomi-san commented on June 11, 2024

In case of switching to custom scheme, what will you do

  • Replacing https://plugins with pengu://plugins, that has no meaning
  • Replacing https://plugins with plugins://<name> (name is TLD, alias of pkg), you will do more work

And both cases need to redirect ALL requests that point to https://plugins/. Also exising plugins have used fetch to acquire their resouces will not work.

I will not handle this case.

from penguloader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.