original_docstring: Call a userscript from a hint.
  
          Args:
              elem: The QWebElement to use in the userscript.
              context: The HintContext to use.
          
docstring: Call a userscript from a hint.
docstring_tokens: Call a userscript from a hint .
code: def call_userscript(self, elem: webelem.AbstractWebElement,
                          context: HintContext) -> None:
          """Call a userscript from a hint.
  
          Args:
              elem: The QWebElement to use in the userscript.
              context: The HintContext to use.
          """
          # lazy import to avoid circular import issues
          from qutebrowser.commands import userscripts
  
          cmd = context.args[0]
          args = context.args[1:]
          env = {
              'QUTE_MODE': 'hints',
              'QUTE_SELECTED_TEXT': str(elem),
              'QUTE_SELECTED_HTML': elem.outer_xml(),
          }
          url = elem.resolve_url(context.baseurl)
          if url is not None:
              flags = QUrl.FullyEncoded
              env['QUTE_URL'] = url.toString(flags)  # type: ignore[arg-type]
  
          try:
              userscripts.run_async(context.tab, cmd, *args, win_id=self._win_id,
                                    env=env)
          except userscripts.Error as e:
              raise HintingError(str(e))
code_tokens: def call_userscript ( self , elem : webelem . AbstractWebElement , context : HintContext ) -> None : from qutebrowser . commands import userscripts cmd = context . args [ 0 ] args = context . args [ 1 : ] env = { 'QUTE_MODE' : 'hints' , 'QUTE_SELECTED_TEXT' : str ( elem ) , 'QUTE_SELECTED_HTML' : elem . outer_xml ( ) , } url = elem . resolve_url ( context . baseurl ) if url is not None : flags = QUrl . FullyEncoded env [ 'QUTE_URL' ] = url . toString ( flags ) try : userscripts . run_async ( context . tab , cmd , * args , win_id = self . _win_id , env = env ) except userscripts . Error as e : raise HintingError ( str ( e ) )
short_docstring: Call a userscript from a hint.
short_docstring_tokens: Call a userscript from a hint .
comment: """Call a userscript from a hint.
  
          Args:
              elem: The QWebElement to use in the userscript.
              context: The HintContext to use.
          """$SEP$# lazy import to avoid circular import issues$SEP$# type: ignore[arg-type]