localStorage['settings']

localStorage['settings']

コード

1

    if (!localStorage['settings']) {
        var defaultSettings = {
            extension_path: chrome.extension.getURL(''),
            display_message_bar: true,
            exclude_patterns: localStorage['exclude_patterns'] || ''
        }
        localStorage['settings'] = JSON.stringify(defaultSettings)
    }

2

chrome.extension.onConnect.addListener(function (port) {
	port.onMessage.addListener(function (message, con) {
		if (message.name == 'settings') {
			var res = JSON.parse(localStorage['settings'])
			res.exclude_patterns += ' ' + excludes.join(' ')
			con.postMessage({
				name: message.name,
				data: res
			})
		}
		//
		// snip
		//
	})
})

3