Projects STRLCPY autorize Commits f01b0602
🤬
  • Added support to allow the URL to be copied via shortcut keys. Command + C

  • Loading...
  • terminalJunki3 committed 1 year ago
    f01b0602
    1 parent f385b540
  • ■ ■ ■ ■ ■ ■
    gui/tabs.py
    skipped 28 lines
    29 29  from javax.swing import JTable
    30 30  from javax.swing import AbstractAction
    31 31  from java.awt.event import KeyEvent
     32 +from java.awt.event import InputEvent
     33 + 
    32 34   
    33 35  class ITabImpl(ITab):
    34 36   def __init__(self, extender):
    skipped 48 lines
    83 85   # Define the key combination for the shortcut
    84 86   
    85 87   keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_R, Toolkit.getDefaultToolkit().getMenuShortcutKeyMaskEx())
     88 + keyStroke1 = KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.META_DOWN_MASK)
    86 89   
    87 90   # Get the input and action maps for the JTable
    88 91   inputMap = self._extender.logTable.getInputMap(JTable.WHEN_FOCUSED)
    skipped 2 lines
    91 94   # Bind the key combination to the action
    92 95   inputMap.put(keyStroke, "myShortcutAction")
    93 96   actionMap.put("myShortcutAction", SendModifiedRequestToRepeaterAction(self._extender, self._extender._callbacks))
     97 + 
     98 + # Bind the key combination to the action
     99 + inputMap.put(keyStroke1, "copyToClipBoard")
     100 + actionMap.put("copyToClipBoard",
     101 + CopySelectedURLToClipBoard(self._extender, self._extender._callbacks))
    94 102   
    95 103   sendResponseMenu = JMenuItem("Send Responses to Comparer")
    96 104   sendResponseMenu.addActionListener(SendResponseComparer(self._extender, self._extender._callbacks))
    skipped 178 lines
    275 283   secure = True if proto == "https" else False
    276 284   
    277 285   self._callbacks.sendToRepeater(host, port, secure, request.getRequest(), "Autorize")
     286 + 
     287 +class CopySelectedURLToClipBoard(AbstractAction):
     288 + def __init__(self, extender, callbacks):
     289 + self._extender = extender
     290 + self._callbacks = callbacks
     291 + 
     292 + def actionPerformed(self, e):
     293 + stringSelection = StringSelection(str(self._extender._helpers.analyzeRequest(
     294 + self._extender._currentlyDisplayedItem._requestResponse).getUrl()))
     295 + clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard()
     296 + clpbrd.setContents(stringSelection, None)
Please wait...
Page is in error, reload to recover