Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Import .rjson by default to firefox extension

Options
  • 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