Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Import .rjson by default to firefox extension

  • 28-09-2013 12:11PM
    #1
    Closed Accounts Posts: 2,301 ✭✭✭


    Hi,

    I'm using this redirection extension for firefox https://addons.mozilla.org/en-us/firefox/addon/redirector/

    Basically, I want to modify it and package it so that people can download it with several redirections already preconfigured.

    It allows you import/export redirects in a .rjson file format. However, instead of sending a .rjson to my friends and getting them to import it, can I package it so that the extension already comes with that file already imported?

    Basically I need someone to maybe download it and have a look around, I know it's a lot to ask, but I'd really appreciate it!

    Thanks, ;)


Comments

  • Closed Accounts Posts: 2,301 ✭✭✭The One Who Knocks


    Just an update,

    I've found the code that references the import in the redirector-ui.js
    function importRedirects() {
    	var file = getFile('importCaption', FilePickerMode.open);
    	var result;
    	if (!file) {
    		return;
    	}
    

    Instead of being able to import using the filepicker, can I set it to automatically import redirections from a different specified location?

    Edit: Found this in redirector.js, see code in bold.
    Where is the location of the redirections file?

    Does this mean that if I just exported the extension now, and installed it on a different machine, all my redirections would be already installed? If so, how do I go about doing that?
    //Private members and methods
    			
    	_prefs : null,
    	_list : null,
    	_strings : null,
    
    	init : function() {
    		if (this._prefs) {
    			this._prefs.dispose();
    		}
    		this._prefs = new RedirectorPrefs();
    		this.debug('REDIRECTOR CREATED');
    		//Check if we need to update existing redirects
    		var data = this._prefs.redirects;
    		var version = this._prefs.version;
    		this._loadStrings();
    		this._list = [];
    		this.handleUpgrades();
    		var redirectsFile = this._getRedirectsFile();
    		[B]if (redirectsFile.exists()) {
    			this.importRedirects(redirectsFile);[/B]
    		}
    


Advertisement