def spec_as_json
      json = {
        :name => spec.name,
        :version => spec.version,
        :manifest_version => calculate_manifest_version
      }

      json[:description] = spec.description if spec.description
      json[:icons] = spec.icons
      json[:default_locale] = spec.default_locale if spec.default_locale
      json[:browser_action] = action_as_json(spec.browser_action) if spec.browser_action
      json[:page_action] = action_as_json(spec.page_action) if spec.page_action
      json[:app] = packaged_app_as_json if spec.packaged_app
      if spec.background_page
        json[:background] = { :page => spec.background_page }
      end
      unless spec.background_scripts.empty?
        json[:background] = { :scripts => spec.background_scripts }
      end
      json[:chrome_url_overrides] = spec.overriden_pages unless spec.overriden_pages.empty?
      json[:content_scripts] = content_scripts_as_json unless spec.content_scripts.empty?
      json[:content_security_policy] = spec.content_security_policy if spec.content_security_policy
      json[:homepage_url] = spec.homepage if spec.homepage
      json[:incognito] = spec.incognito_mode if spec.incognito_mode
      json[:intents] = web_intents_as_json unless spec.web_intents.empty?
      json[:minimum_chrome_version] = spec.minimum_chrome_version if spec.minimum_chrome_version
      json[:nacl_modules] = nacl_modules_as_json unless spec.nacl_modules.empty?
      json[:offline_enabled] = spec.offline_enabled unless spec.offline_enabled.nil?
      json[:omnibox] = spec.omnibox_keyword if spec.omnibox_keyword
      json[:options_page] = spec.options_page if spec.options_page
      json[:permissions] = spec.permissions unless spec.permissions.empty?
      json[:requirements] = requirements_as_json if has_requirements?
      json[:update_url] = spec.update_url if spec.update_url
      json[:web_accessible_resources] = spec.web_accessible_resources unless spec.web_accessible_resources.empty?

      json
    end
def spec_as_json
      json = {
        :name => spec.name,
        :version => spec.version,
        :manifest_version => calculate_manifest_version
      }

      json[:description] = spec.description if spec.description
      json[:icons] = spec.icons
      json[:default_locale] = spec.default_locale if spec.default_locale
      json[:browser_action] = action_as_json(spec.browser_action) if spec.browser_action
      json[:page_action] = action_as_json(spec.page_action) if spec.page_action
      json[:app] = packaged_app_as_json if spec.packaged_app
      if spec.background_page
        json[:background] = { :page => spec.background_page }
      end
      unless spec.background_scripts.empty?
        json[:background] = { :scripts => spec.background_scripts }
      end
      json[:chrome_url_overrides] = spec.overriden_pages unless spec.overriden_pages.empty?
      json[:content_scripts] = content_scripts_as_json unless spec.content_scripts.empty?
      json[:content_security_policy] = spec.content_security_policy if spec.content_security_policy
      json[:homepage_url] = spec.homepage if spec.homepage
      json[:incognito] = spec.incognito_mode if spec.incognito_mode
      json[:intents] = web_intents_as_json unless spec.web_intents.empty?
      json[:minimum_chrome_version] = spec.minimum_chrome_version if spec.minimum_chrome_version
      json[:nacl_modules] = nacl_modules_as_json unless spec.nacl_modules.empty?
      json[:offline_enabled] = spec.offline_enabled unless spec.offline_enabled.nil?
      json[:omnibox] = spec.omnibox_keyword if spec.omnibox_keyword
      json[:options_page] = spec.options_page if spec.options_page
      json[:permissions] = spec.permissions unless spec.permissions.empty?
      json[:requirements] = requirements_as_json if has_requirements?
      json[:update_url] = spec.update_url if spec.update_url
      json[:web_accessible_resources] = spec.web_accessible_resources unless spec.web_accessible_resources.empty?

      json
    end
Return the JSON representation of the specification