Skip to content

Import Export Guide

Bassam Helal edited this page Apr 29, 2020 · 7 revisions

Wudooh allows you to import and export your settings into and out of the extension.

This allows you to use Wudooh across browsers and also view and edit your settings in your favorite text editor.

The Import/Export Setting feature uses the widely popular JSON format to represent the data stored in the extensions storage.

The extension is very strict about what it allows to be imported so below is the JSON "schema" of what is considered acceptable settings. If you would rather just download a copy of the default settings you can do so here.

JSON Schema

Because this is JSON, the order in which these objects appear does not matter.

"onOff" : boolean

This represents whether the extension is on or off. true for on or false for off.

"font" : string

This represents the global font selected. No checking is done here (yet) to ensure that the font is valid or not, thus you can enter a custom font name.

"textSize": number

This represents the global text size or font size. This must be a number between 100 inclusive and 300 inclusive.

"lineHeight": number

This represents the global line height. This must be a number between 100 inclusive and 300 inclusive.

"whitelisted": Array<string>

This represents the whitelisted hostnames. This is an array of the hostnames. The hostnames format differs depending on site, most will use the new apex hostname format such as github.com but some sites still use the classic www prefix such as www.youtube.com.

You can find out how Wudooh (and even your browser in general) sees the current document's hostname through Wudooh's interface in the website info section under "Line Height".

"customSettings": Array<CustomSetting>

This represents the list of sites with custom settings or "site-specific settings". A CustomSettings object is as follows:

"url": string

The hostname that this custom setting applies to. Note the same hostname rules of whitelisted apply here.

This is used as the key of a CustomSetting meaning that there can exist only one CustomSetting with a given url.

"font": string

The font to use on this url. This behaves similarly to the global font setting except it will only apply to this CustomSetting's url.

"textSize": number

The textSize to use on this url. This behaves similarly to the global textSize setting except it will only apply to this CustomSetting's url.

"lineHeight": string

The lineHeight to use on this url. This behaves similarly to the global lineHeight setting except it will only apply to this CustomSetting's url.

"customFonts": Array<CustomFont>

NOTE: The Custom Fonts feature is in beta, things may change or break in the future

This represents the list of custom fonts.

Read more about Custom Fonts in the Custom Fonts Guide

A CustomFont object is as follows:

"fontName": string

The name of the font family. This will be injected into pages as the font-family property of the CSS @font-face.

This is used as the key of a CustomFont meaning that there can exist only one CustomFont with a given fontName.

"url": string

The url of the font's src if it has one. This will be injected into pages as the src: url property of the CSS @font-face. This can be null if you are using a localName instead.

"localName": string

The local name (installed name) of the font's src if it has one. This will be injected into pages as the src: local property of the CSS @font-face. This can be null if you are using a url instead.


Below is an example of a valid settings file to be imported.

{
    "onOff": true,
    "font": "Droid Arabic Naskh",
    "textSize": 125,
    "lineHeight": 145,
    "whitelisted": [
        "github.com"
    ],
    "customSettings": [
        {
            "url": "github.com",
            "font": "Droid Arabic Naskh",
            "textSize": 125,
            "lineHeight": 145
        }
    ],
    "customFonts": [
        {
            "fontName": "Font Name",
            "url": "Font URL",
            "localName": "Local Name"
        }
    ]
}

Below is the default settings that Wudooh uses.

{
    "onOff": true,
    "font": "Droid Arabic Naskh",
    "textSize": 125,
    "lineHeight": 145,
    "whitelisted": [],
    "customSettings": [],
    "customFonts": []
}