cacodaimon / ghosttext-for-chrome Goto Github PK
View Code? Open in Web Editor NEWGhostText Chrome extension
GhostText Chrome extension
Use the commands API to add keyboard shortcuts that trigger actions in your extension
https://developer.chrome.com/extensions/commands
Possible keys
Chrome | Firefox | Reason | |
---|---|---|---|
OS X | CMD+K | CMD+K | Used by Finder to "Connect server..." |
Linux | Ctrl+Shift+H | ||
Windows | Ctrl+Shift+K |
On GitHub, the same textarea is reused after leaving a comment. We could implement some generic submit
detection as well some site-specific listeners.
Test page here: https://help.disqus.com/customer/portal/questions/6515747-how-can-i-delete-discussions-
GT can't see the textarea in that iframe, it's a different document. Problem is… there is a wontFix bug on Chromium: https://code.google.com/p/chromium/issues/detail?id=57601
I'll have to look further into this, we might have to go back to the always-loaded content.js (which might have the same issue, but I don't know)
We don't support multiple fields on a page, but apparently there are use cases for them. #33 is one, CodePen.io is the other very-nice-to-have is the other one (CodeMirror)
Instead of opening a connection and editor tab for each field, we could just automatically follow the user focus:
(this gif highlights on hover, but I mean on focus)
Instead of connecting 1 Field <-> 1 ST tab
, we can just keep it 1 Ch tab <-> 1 ST tab
Hi there,
I discovered this extension and corresponding Sublime Text plugin while browsing the "new packages" section on PackageControl and I am very thrilled to try it out!
Unfortunately I get the following error message when adding the extension manually (as described in the README):
The installation from the web store fails with the following message:
There was a problem adding the item to Chrome. Please refresh the page and try again.
I would appreciate any help in getting GhostText to work. I've been looking for something like this for a while.
BR, Feltzer
The activeTab permission gives an extension temporary access to the currently active tab when the user invokes the extension
Now:
activeTab:
Moved from: fregante/GhostText#52 Moved back
Let's wait until #6 is implemented first.
Expected behavior in clicks:
Right now it's not entirely clear which functions are meant to be used on the page and which are not. From what I understand, most of them are exclusive to either side (e.g. GhostText.connections
is only filled in background.js; GhostText.connectTextArea()
can't be used anywhere but content.js) so it would make sense to split libs.js
into two files, perhaps only leaving common functions in there—if any.
What do you think?
When one textarea is present or if one is focused, the button now automatically connects. If more than one unfocused textareas are present, we wait for the user selection of a textarea.
We need to let the user know what he has to do.
Origin Issue: fregante/GhostText#42 (comment)
Right now it seems that once the connection is open, if I type in the textarea, any key will replace the entire content.
I would be best to allow two-way synchronization, but if that's too hard, I'd suggest making it <textarea readonly>
.
If we go with the latter, a click on the read-only textarea should enable it and close the connection. Before we do that we should implement #6 so that the user knows that the connection has been closed.
We could make Sublime Text come up automatically (as an option) as soon as the user starts typing in a field, to make it as seamless as possible
It might take a bit to implement correctly, though, we don't want this to be annoying
The only problem with this is that we need again the permission to run code on all pages, even though it could be minimal This for example support dynamically-added fields and it even works with ACE and CodeMirror:
document.addEventListener('onkeypress', function (e) {
GhostText.enableIfFieldIsSupported(e.target);
});
I asked for a new logo on a Facebook group of webdesigners, hopefully someone will come forward with something nice. We'll need something 128x128 for the Chrome Store and 19x19 specifically for the browser button.
Initially discussed on #3, it can be expanded to use elements of the page to detect the platform and therefore the format (HTML for WordPress blogs, BB code for forums, etc)
The keyboard hotkey currently defined in manifest.json - Ctrl + Shift + B - is already in use by Google Chrome, controlling the visibility of the bookmarks bar.
I would recommend setting it to a different key combination, e.g. Ctrl + Shift + H.
If an error occurs the element highlight does not get removed.
Right now the textarea is highlighted even if the connection fails
Codecademy's HTML & CSS track lets the user switch between separate files for HTML and CSS. I'm not sure whether the same textarea is used, but the file contents are replaced when switching tabs, and the same part of the screen stays highlighted as if it were connected to GhostText. However, the new file contents are not shown in Sublime Text.
Once GhostText is connected, it binds to the active file, and won't edit the other file unless the page is entirely reloaded. For instance, disconnecting, switching files and reconnecting just connects to the original file.
This also means GhostText can keep updating a file which is no longer visible (eg it keeps editing HTML after the user switches the view to CSS). (When this happens, Codecademy doesn't notice the changes, unless the user switches to the file again and makes another change in Sublime Text.)
It's not working properly while writing a mail in Yahoo or writing text in titanpad.
When I press ctrl+shift+h 4-5 sublime windows pop up over the chrome. If I enter text in any sublime window, then it's not getting synced with the browser text box.
When I close those windows, then the following error is displayed on the browser
Connection error.
Make sure that Sublime Text is open and has GhostText installed.
Try closing and opening it and try again.
Make sure that the port matches (4001 is the default).
Which I understand happens because I am closing all the sublime windows. But why 4-5 windows are being opened?
I have enabled the new_window_on_connect
mode.
We need a UI where people can configure which syntax has to be send to server guessed by the tab's URL.
There is already a method stub in GhostText.guessSyntax()
for performing this task in the background.
For example:
"github.com" --> "markdown",
"cacodaemon.de" --> "html",
"wikipedia.*" -> "wikitext"
…
Google Mail uses their own "content editable" element, those are in a iframe
therefore #36 has to be solved first before start researching how this kind of element works.
https://developer.chrome.com/webstore/images?hl=en#promo
- Small: 440x280 pixels (required)
- Large: 920x680 pixels
- Marquee: 1400x560 pixels
Logo available here, font is Roboto Slab
Periodically I have the error where "starting" ghost text does not propagate sublime with the code from the text box. GhostText says it is running, but no code is visible.
TextArea highlighting remains when tab inside website is changed but the connection is being terminated.
Video showing the bug : https://www.youtube.com/watch?v=Zym294o8HlY
EDIT:
Well sortof connected with this bug I think.
You're able to connect multiple pages at once it They are in different chrome tabs. If They're as in the video above, you can connect only one sice by changing website tab you get disconnected. I'm not sure if that can be fixed. Would be great if it does.
⌘ + K is clear for the console and it triggers this insted, so you can't use this to turn it on and off the app.
This might happen on ajax-powered pages, where after leaving a comment the textarea is detached.
Use the system implemented for #5 to show background/connect error on the page instead of alert()
Following fregante/GhostText/issues/4
Following fregante/GhostText#14 we need to properly close the connection in the tab since the textarea highlight and event listeners currently stay on.
Update GhostText in the web store when fregante/GhostText#17 has been closed.
We have to wait until the pull request has been merged by the Package Control team.
Chrome 36+ does not allow insecure connections within https pages, currently the WebSockets gets opened by the content script which causes a SecurityError. Using --disable-web-security
is only a dirty and not user friendly workaround.
By opening the connection by the background script and messaging between the content script and the background script should bypass this security check.
Origin: fregante/GhostText#5
The chrome addon highlights the textarea in IPBoard admin panel and shows message to switch to editor. Editor creates new tab/window but without textarea content and console spills out this :
windows
WebSocketServer id: 1
Setting on message handler
Setting on close handler
Start
Listening on: 58562
Exception in thread Thread-5:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "GhostText in C:\Users\SEJBR\AppData\Roaming\Sublime Text 3\Installed Packages\GhostText.sublime-package", line 33, in run
File "WebSocket.WebSocketServer in C:\Users\SEJBR\AppData\Roaming\Sublime Text 3\Installed Packages\GhostText.sublime-package", line 72, in start
OverflowError: Python int too large to convert to C ssize_t
Exception in thread Thread-2:
Traceback (most recent call last):
File "X/threading.py", line 639, in _bootstrap_inner
File "GhostText in C:\Users\SEJBR\AppData\Roaming\Sublime Text 3\Installed Packages\GhostText.sublime-package", line 74, in run
File "Http.HttpServer in C:\Users\SEJBR\AppData\Roaming\Sublime Text 3\Installed Packages\GhostText.sublime-package", line 29, in start
File "Http.HttpServer in C:\Users\SEJBR\AppData\Roaming\Sublime Text 3\Installed Packages\GhostText.sublime-package", line 91, in _parse_request
ValueError: need more than 1 value to unpack```
Both Chrome addon and sublime plugin are set to 4001 port.
The above error seems to fix everytime I change port to different one.
Also
When you close connection you have to restart sublime to create a new one.
I haven't noticed anything in console when that happens.
This issue is a child of: fregante/GhostText#12
When I click into my editable area, my sublime text renders blank. It is only occuring in Marketo, Marketing software.
Some websites like Facebook don't use the textarea conventionally (they use one textarea for the whole website and move it around) so don't work as intended, so they should be excluded and the user will need to be informed.
When I click on the button in chrome, it switches to sublime text and nothing happens. The error in the console is:
WebSocketServer id: 1
Setting on message handler
Setting on close handler
Start
Listening on: 52672
Exception in thread Thread-82:
Traceback (most recent call last):
File "WebSocket.WebSocketServer in /Users/JConnolly/Library/Application Support/Sublime Text 3/Installed Packages/GhostText.sublime-package", line 61, in start
File "WebSocket.Frame in /Users/JConnolly/Library/Application Support/Sublime Text 3/Installed Packages/GhostText.sublime-package", line 52, in parse
IndexError: index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./threading.py", line 901, in _bootstrap_inner
File "GhostText in /Users/JConnolly/Library/Application Support/Sublime Text 3/Installed Packages/GhostText.sublime-package", line 33, in run
File "WebSocket.WebSocketServer in /Users/JConnolly/Library/Application Support/Sublime Text 3/Installed Packages/GhostText.sublime-package", line 63, in start
UnboundLocalError: local variable 'e' referenced before assignment
Some small switches are needed like other CustomEvent creation or that the content editable has no input
event . Some are already added to the Firefox input-area.js
but needs to be backported and tested for not breaking the Chrome extension.
Right now SO's preview only works when typing in the browser, but not when in ST, so I assume we have to somehow trigger the events that SO (and other similar sites) is listening for
Idea: use Sublime Text to write in the browser's developer console.
It seems like its natural evolution: you write code in the console—exclusively; why not use your text editor to do it? It could be integrated into the current Chrome extension or made as a separate extension (for visibility).
Before we go any further, can we agree to follow this procedure to restore the repo?
After successful use and disconnection, we could prompt the user to leave feedback on the Chrome Web Store and more importantly to contribute and report issues on GitHub.
This could happen every week/month (a longer message) and/or at every disconnection (a short message like "Disconnected! Issues? Report on GitHub. Happy? Leave rating")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.