kylepaulsen / ResourceOverride

An extension to help you gain full control of any website by redirecting traffic, replacing, editing, or inserting new content.
MIT License
467 stars 117 forks source link

Improvements that can be added - RegexReplacer + cloud sync (Forked and fully working version is available with all code) #51

Open starkapandan opened 3 years ago

starkapandan commented 3 years ago

Hi, thanks for an awesome extension, there was some important features specifically for me that was missing and that no other plugin had so i really had no other options than to code it by hand.

I created a forked version(https://github.com/starkapandan/ResourceOverride) and would one day possibly see these features added to the real plugin.

The most important one here is a regex live file replacer(please check readme on fork for exact details) instead of fileoverride. The issue with file override is that once developers update their script it simply breaks the site when overriding with old fileoverride. A regex replacer handles this case perfectly by always fetching up to date script and before its loaded into website uses regex replacing of certain sections.

All of this functionality is available in the fork for you to copy paste if you would have time, i simply placed under a new rule called "filereplacer" so other type of rules are untouched. Obviously migrating this over to here would be a little more work than copy and paste, but the functionality is already coded for that specific rule only, and can be added with fairly little work.

Now another one that would be awesome to see is some form of cloud sync. I know that this is currently impossible with chrome.storage.sync since it has such low quota for fairly large settings BUT, in my forked version i have managed to this in a fairly simple way, just to maybe illustrate a possible workaround (only works if it's loaded in chrome settings "load unpacked plugin"). To accomplish this, i placed all of the settings DIRECTLY in a file called config.js in same directory as the plugin. Now if you place the whole plugin into a dropbox/onedrive/googledrive synced folder, and load plugin directly from there into chrome. you will have the plugin + all settings synced to all your computers. And if you want to change settings, this is done in the config.js file instead of the webui or developers tab.