Code Monkey home page Code Monkey logo

Comments (4)

kylepaulsen avatar kylepaulsen commented on July 25, 2024 1

if the file name has no patterns to it (other than having a .js at the end) then yeah the best you can do is something like:
https://somesite.com/js/*.js
which would obv overwrite everything that ends in js. However! you can also have overrides go to the original location like this:
https://somesite.com/js/main.js -> https://somesite.com/js/main.js
Seems pointless right? Well, if you put this rule above the rule with the * in it, then main.js wont get overridden.

But yeah if all js files have random names and you only want to override one of them, then I'm not sure what to do.

Maybe block all scripts and then copy paste and inject each script.

from resourceoverride.

jmscavaleiro avatar jmscavaleiro commented on July 25, 2024

Hi Kyle!

Many thanks for your answer. But there is a way: (not The Mandalorian one but it could 😉)

Do you have a way to read the file name of the source that will be override and give your file the same name?

We can divide the feature in two:

  1. If the source folder only have one file it will be pretty straightforward.
  2. If the folder contains more than a file, the system must identify which file to override based on a couple of rules. For instance: the number of lines of code inside each and match with the desired file based on it. Or if it finds a specific string inside it. Or simply put (but maybe hardly done): the user could decide in runtime whitch file should match to override.

What do you think? It's doable?

Kind regards,
João Cavaleiro

from resourceoverride.

jmscavaleiro avatar jmscavaleiro commented on July 25, 2024

Hi Kyle,

I am willing to develop the above suggested features. Is it okay for you to fork the code and go ahead?

Kind regards,
João Cavaleiro

from resourceoverride.

kylepaulsen avatar kylepaulsen commented on July 25, 2024

I am no longer accepting PRs for this repo unless for critical basic functionality bug fixes. This project has been in maintenance mode ( https://github.com/kylepaulsen/ResourceOverride/blob/master/maintenance_notice.md ) for a while now.

You are free to do whatever you like with the code, so long as you follow the included license. https://github.com/kylepaulsen/ResourceOverride/blob/master/LICENSE

from resourceoverride.

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.