def webpage_option_getter(attr):
    """ Helper function for defining getters for web_page options, e.g.
    ``get_images_enabled = webpage_option_getter(QWebSettings.AutoLoadImages)``
    To be used in BrowserTab subclasses.
    """
    def _getter(self):
        settings = self.web_page.settings()
        return settings.testAttribute(attr)
    return _getter