Giter VIP home page Giter VIP logo

Comments (20)

crssi avatar crssi commented on June 19, 2024 1

Import/Export I would anticipate most. :)
Sync is nice too, but not as important as Import/Export

Thank you

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024 1

@ldgbc @Atavic By the way the wiki is public if you want to create some page for sharing rules there. And if you wish to include some of your rules as default rules in RC, open a new issue for that.

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024 1

@crssi you can do that by selecting a single rule in the rules view.

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

Download API for exporting and file input for importing:
http://stackoverflow.com/a/38838572

from requestcontrol.

crssi avatar crssi commented on June 19, 2024

Hi @tumpio, do you have any ETA for this implemntation?

Anyway... very very good job and thank you for sharing this extension.

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

Hi @crssi I can't give any ETA other than 🔜 I'm working on it :)

If you want to cheer me up buy me a cup of coffee!

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

@crssi also which one do you anticipate most, rules import/export or the sync support?

from requestcontrol.

crssi avatar crssi commented on June 19, 2024

@tumpio Promised coffee on the way. But crap, had to use Internet Explorer. Even fresh installation of FF v53 and FF v54 did not work,.

from requestcontrol.

crssi avatar crssi commented on June 19, 2024

Been thinking
Maybe you can make export as a download config file generated on the request?
Or the way gorhill implemented this for uBlock Origin and uMatrix.

It would be some real enhancement if there would be an option to export/import single filter... maybe a text box with filter config data in some sort of XML or JSON format.

from requestcontrol.

ke-d avatar ke-d commented on June 19, 2024

I found a workaround to transfer extension data that should work for all WebExtensions.

Ex. For Request Control which has an ID of {1b1e6108-2d88-4f0f-a338-01f9dbcccd6f}

  1. Go into your profile and then browser-extension-data/{1b1e6108-2d88-4f0f-a338-01f9dbcccd6f}
  2. Copy the storage.js file
  3. Transfer that file into another profile
  4. 😉

But, it'll probably be better to have export/import in the extension itself.

Here's some sample code of how I did it

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

@mrdokenny @crssi

can you try new beta version with export and import:
https://addons.mozilla.org/addon/requestcontrol/versions/1.7.0beta1

@mrdokenny nice to know about this :)

from requestcontrol.

ke-d avatar ke-d commented on June 19, 2024
function exportObject(name, object) {
    let mimeType = "application/json",
        data = JSON.stringify(object, null, 2),
        blob = new Blob([data], {type: mimeType});
    return browser.downloads.download({
        url: URL.createObjectURL(blob),
        filename: name,
        conflictAction: "overwrite",
        saveAs: true
    }).then(revokeObjectUrl);
}

I didn't use the download API because I didn't want to request another permission just for that, but it nice to know that it doesn't have this one problem, which just uses regular JS.

As for the beta version, importing the rules seem to not take into account duplicates.

STR:

  1. Export rules
  2. Import them again
  3. See duplicates for the default rules

Another thing is the file upload button can be stylized

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

Using a downloads API for creating a download seemed quite applicable for the job! :)

Duplicates handling is quite excessive, I think.

Another thing is the file upload button can be stylized

I'm using bootstrap which doesn't include styling for it.

from requestcontrol.

ke-d avatar ke-d commented on June 19, 2024

Duplicates handling is quite excessive, I think.

It depends on how you consider one rule to be the same from another one.
Ex. You could make it so if the path, types, action are the same, append the hosts into one rule.

I'm using bootstrap which doesn't include styling for it.

You can overlay the input in a label and use the bootstrap button css on it.
Sample code:

<label class="file-upload">
	<input id="importURLS" type="file"/>
	<div id="importURLSText">Upload File</div>
</label>
.file-upload {
  display: inline-block;
  height: 38px;
  padding: 0 30px;
  color: #555;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 38px;
  letter-spacing: .1rem;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  background-color: transparent;
  border-radius: 4px;
  border: 1px solid #bbb;
  cursor: pointer;
  box-sizing: border-box;	
}

input[type="file"] {
  display: none;
}

capture

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

I'll leave it here myself. If you want to work on it feel free. I'll consider adding sync support once the android options issue is fixed.

from requestcontrol.

ldgbc avatar ldgbc commented on June 19, 2024

Cool. There is export and import system now. Anyone want to share some of their rules?
I attached two of mine that I currently use (didn't add many since it wasn't working before with e10s or my browser setting).

Thank you @tumpio good to see it being supported still. Also it seem to be being developed with the new add-on function. Hopefully it Mozilla don't fail it and it kill all good XUL addons with a possibility of replacement but now there is one for Cleaning Links (yours).

request-control-rules-sharing.zip

from requestcontrol.

Atavic avatar Atavic commented on June 19, 2024

@ldgbc nice sharing idea, but what do your rules do?

from requestcontrol.

crssi avatar crssi commented on June 19, 2024

It would also be nice to be able to export single rule only. This way it would be easier to share rules between users. ;)

from requestcontrol.

crssi avatar crssi commented on June 19, 2024

Haven't seen that... it awesome, ;)

from requestcontrol.

tumpio avatar tumpio commented on June 19, 2024

I'm afraid sync support has to wait. Android support is lacking for it.

from requestcontrol.

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.