Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting notepad++ with browser textarea directly

So basically the company I work in has me using a browser textarea to write JS code because of security stuff they have that cannot be bypassed. I am quite used to using IDEs for writing code and the current arrangement is quite inefficient. Is there any way to create a script/program that can directly copy over what I write in an IDE (for an example notepad++ or sublime/webstorm etc.) to a textarea open in the browser. Of course the idea is that this should happen automatically.

It seems far fetched but I'm quite desperate at this point. Losing way too much time copying manually from IDE to the browser over and over again.

If such an application doesn't exist.. then how hard would it be for me to create it? I am a web developer and have no experience in desktop applications.

like image 762
Decorayah Avatar asked Dec 02 '25 20:12

Decorayah


1 Answers

One way of doing this is to have a script to copy the contents of the file you are working on and then paste it into the required input field on the web page. You could run this by double clicking it, or having it set up as a schedued task, or create a keyboard macro to run the file.

Whether or not this actually helps you depends on the details of your requirements, but maybe it will give you some ideas.

The script simply opens a given web page, inserts data to the given field, and then closes the page.

open-webpage-insert-data.ps1

$url = "https://google.co.uk"
$codefile = "C:\test.txt"
$inputid = "lst-ib"
# Get the code
$code = Get-Content $codefile
# Create Internet Explorer instance and navigate to the page
$ie = New-Object -com "InternetExplorer.Application"
$ie.visible = $true
$ie.Navigate($url)
While ($ie.readyState -ne 4) { }
# Insert the code and quit IE
$ie.Document.GetElementById($inputid).Value = $code
$ie.Quit()

It may be useful to first check the current value of the input field or remove whatever is there already before pasting the copied code, but this obviously depends on what your setup is.

like image 146
Bassie Avatar answered Dec 05 '25 11:12

Bassie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!