Git Product home page Git Product logo

browser-window-popup's Introduction

browser window popup

a basic unpublished example of a Windows native Firefox extension to quickly open Google Translate with a selected text in a popup window from anywhere on the system . you can select any text and press ctlr+c+c , on which a browser popup window will open with the translation of the selected text .

made just for fun and learning . i low key wanted to have something like this polished and published , but i did not have resources to make it serious project out of it . so only showing how it could be aproached for anyone interested .

if you find this useful , leave a star .

why

the problem is that any other free and/or open-source solutions for quick translator/dictionary/wikis/search/etc popup-ing could only do the following :

  • open a popup with custom GUI for existing online or offline services , e.g. GoldenDict and alternatives .
  • open a full tab in your browser , e.g. SnipDo and alternatives .
  • work only inside of a browser .

how

since a browser extension alone has no access to what a user selects on other apps , i use native messaging stack . the extension spawns the application that runs in the background . the app waits for the key sequence and sends a message with a text and cursor position data to the extension .

limitations

  • the application uses Windows clipboard to copy a selected text with the first c while ctrl is held . so , not to overcomplicate , ctrl+c+c is hardcoded and not configurable yet . the clipboard method is the most reliable way to actually get the selected text from other applications as many do not expose to the OS what you select , e.g. browsers . as a bonus , this solution works nice with OCR tools like NormCap which recognise text from an area-screenshot and copy it to the clipboard anyway .
  • the browser must already be open . i don't like this , but it's the nature of the extensions .

setup and usage

  1. build a C++ application with CMake . i used CLion and MinQW toolchain . no libs required except from Windows API which should be installed by default .
  2. run a registry update script with PowerShell . this is needed for Firefox to find the application .
  3. add an extension to your Firefox as a temporary addon . how to : Mozilla docs .

browser-window-popup's People

Watchers

dan oak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.