mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Allow web extension to get the content text direction and save
This commit is contained in:
parent
65f5488289
commit
24cec85880
1 changed files with 2 additions and 1 deletions
|
|
@ -134,6 +134,7 @@
|
|||
contentCopyEl.style.left = '-2000px'
|
||||
contentCopyEl.style.zIndex = '-2000'
|
||||
contentCopyEl.innerHTML = document.body.innerHTML
|
||||
const dir = document.dir
|
||||
|
||||
// Appending copy of the content to the DOM to enable computed styles capturing ability
|
||||
// Without adding that copy to the DOM the `window.getComputedStyle` method will always return undefined.
|
||||
|
|
@ -149,7 +150,7 @@
|
|||
* capture them separately and concatenate them here with head and body tags
|
||||
* preserved.
|
||||
*/
|
||||
const contentCopyHtml = `<html><head>${document.head.innerHTML}</head><body>${contentCopyEl.innerHTML}</body></html>`
|
||||
const contentCopyHtml = `<html dir="${dir}"><head>${document.head.innerHTML}</head><body>${contentCopyEl.innerHTML}</body></html>`
|
||||
// Cleaning up the copy element
|
||||
contentCopyEl.remove()
|
||||
return contentCopyHtml
|
||||
|
|
|
|||
Loading…
Reference in a new issue