Comments (12)
In my environment, the version 0.5.7 still copies as a plain text. The steps to reproduce is below:
- Install Create Link from Chrome Web Store. https://chrome.google.com/webstore/detail/create-link/gcmghdmnkfdbncmnmlkkglmnnhagajbm
- Restart Google Chrome.
- Go to https://github.com/ku/CreateLink
- Click the Create Link icon.
- Select HTML.
- Create a Google Docs document.
- Paste on the document.
from createlink.
I think what's going on is that it falls back and fails if the focus isn't on the page itself. I always use a keyboard shortcut and as long as I click inside the webpage first, it works. But I was also able to reproduce it failing by clicking on the extension icon. It also fails with the keyboard shortcut when the URL/address bar is focused (rather than the webpage itself).
from createlink.
This also happens on Mac OS 12.0.1 and Chrome OS. At least since 0.5.1 or so. (Now on 0.5.5 and still happens.)
from createlink.
likewise on linux (Ubuntu 18.04, brave) pasting into google docs.
I'm more or less addicted to this feature. I'm open to contributing financially to see it restored. I started exploring a bounty on bountysource. Do let me/us know if that's of interest.
from createlink.
I'm guessing the problem occurred in this recent change by ku. If I had permissions to work on the project I could probably fix it fairly quickly
from createlink.
... If I had permissions to work on the project I could probably fix it fairly quickly
permission? I don't understand. It's open source. What permission would make any difference as to whether you can fork it and make a pull request?
from createlink.
@ku I'm guessing something to do with changing what's in the clipboard has lost the html version of the clipboard contents which is what enables rich link pasting. Do you know where the fix might be? It's been a while... :)
from createlink.
Another oddity is that the contents of content.js don't seem to match what's in the repo in master 😕
chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
switch (request.type) {
case 'ping':
return sendResponse({type: 'pong'})
case 'showInputDialog':
const text = window.prompt("CreateLink needs your input");
return sendResponse({type: request.type, text});
case 'selectedText':
const s = document.getSelection()
return sendResponse({ type: request.type, text: (s ? s.toString() : '')})
case 'evaluateFilter':
const f = new Function('s', request.code)
return sendResponse({ type: request.type, text: f.call(null, request.string)})
case 'copyToClipboard':
return sendResponse({ type: request.type, text: copyToClipboard(request.link) })
}
});
function copyToClipboard(text) {
// it does not copy the text to clipboard if it's hidden completely by "display: none".
const textarea = document.createElement('textarea')
textarea.setAttribute('style', `
position: absolute;
width: 0.1px;
height: 0.1px;
right: 200%;
opacity: 0.1;
`)
textarea.setAttribute('id', 'clipboard_object')
document.body.appendChild(textarea)
textarea.appendChild(document.createTextNode(text))
textarea.select()
document.execCommand("copy");
textarea.parentNode.removeChild(textarea)
return text
}
I would have expected something looking more like copyToClipboard. Perhaps the package needs to be rebuilt?
from createlink.
Running it locally, I do see even with the latest code that it's falling back to creating a textarea and copying that due to Clipboard API failed DOMException: Document is not focused.
:
Note that based on https://stackoverflow.com/questions/56306153/domexception-on-calling-navigator-clipboard-readtext I also tested without the js console open and the same exception is logged.
from createlink.
Looks like @ku is fixing things. Perhaps 9270657 fixes?
from createlink.
Upgrading to the latest fixes it for me.
from createlink.
it's baaaack!
these symptoms, that is
#41 suggests I'm not the only one seeing this.
from createlink.
Related Issues (20)
- add keyboard shortcuts HOT 5
- feature: default link type support HOT 1
- Create links for all tabs at once HOT 3
- Marked text not substituted for `%text%` when activated via a shortcut key HOT 3
- Allowing char '%' to be escaped in the format column
- Provide keyboard driven means for changing default format (without having to visit options screen) HOT 1
- [feature] option "selected_text_only", useful to avoid duplicating title in [%selected_text_only% %title%](%url%)
- can't build
- Default Font and Size for HTML Link
- %text_n% doesn't work with selected text
- Add support for org-mode format HOT 1
- Feature request - Add BBCode to default formats HOT 1
- First use of Create Link on a page returns the previous string HOT 7
- 'Filter' is not working
- keyboard shortcuts failed on v0.5.7 ,chrom99,win10; mouse works fine.
- Suggest adding URL-encoded text variable to enable deep-linking features HOT 1
- I want you to be able to get the link of the details screen (pop-up) of Google Calendar.
- Possible to create custom format utilizing "URL Fragment Text Directives" for html links, but not markdown.
- HTML stopped working in Chrome on Windows.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from createlink.