Comments (6)
My first guess was that it might be caused by the document starting with <?xml version='1.0' encoding='UTF-8'?>
, so I copied the page locally and tried again, but document.width
worked.
The CSS link was broken though, so I fixed the URL, but it still worked.
The main difference I see between my local file and the hosted one is that the hosted one served as type "application/xhtml+xml".
Various hacky backup widths could be tried out:
// get document width
var width = document.width;
if (width === undefined) {
// if document width fails, e.g., this page http://jblevins.org/projects/markdown-mode/
// then find the biggest element available to grab width
var widthElt = (document.getElementsByTagName('html')[0] ||
document.getElementsByTagName('body')[0] ||
document.querySelector('*'));
// use widthElt’s width or worst-case fallback to the window
width = widthElt ? widthElt.offsetWidth : window.innerWidth;
}
from full-page-screen-capture-chrome-extension.
Hi... interesting!
This might be relevant, though it's from a while ago http://www.sencha.com/forum/showthread.php?243424-ExtJS-3.4-bugs-inside-xhtml-document
This page https://en.wikipedia.org/wiki/Quirks_mode indicates that Chrome should be in Standards mode, and that is the case:
document.compatMode
"CSS1Compat"
I read stuff elsewhere (about zooming & scaling) that adds an SVG element to the document, gets its width, and removes it. That might be another way to get a value.
from full-page-screen-capture-chrome-extension.
Chrome 31.0.1650.48 Win7
I installed the extension a few weeks ago and used it without problems. Starting today I am experiencing the same behavior as described above except it happens on all pages.
I replaced with document.width & height with document.body.clientWidth & clientHeight and it appears to be working. Do these properties not return the values needed? It seems to be working but I can't compare it to what was being returned using the former properties.
I get the same behavior here too.
http://jsfiddle.net/szuranski/t24R9/17/
from full-page-screen-capture-chrome-extension.
What do you guys think of this approach?
I adapted it from a suggestion on this SO page: http://stackoverflow.com/questions/5484578/how-to-get-document-height-and-width-without-using-jquery
from full-page-screen-capture-chrome-extension.
I have used a similar technique when needing to find the max size of the window. It is working with the few captures I have done so far.
from full-page-screen-capture-chrome-extension.
Hey Peter. I just ran into this issue again, as have some people that are using the same code, and the fix you came up with (nice) seems to fix it. We're doing some more testing now.
from full-page-screen-capture-chrome-extension.
Related Issues (20)
- make it compatible with kiwibrowser a chromium fork (5m user) HOT 1
- Repo out of sync with web store HOT 2
- Any way to adjust for PDF files loaded in Chrome? HOT 1
- Add new language
- Doesn't work on Chrome versions 92 and up
- The extension doesn't work on certain websites
- Why not editable (vector-type) PDF?
- Issues on page with page-scroll : smooth or position: fixed or position: sticky
- Transparent background?
- Cpature content of scrollable ifame,
- How to invoke programatically?
- Manifest v3? HOT 1
- Iframe nesting problem HOT 1
- Question on Full Page extension HOT 3
- animation on welcome page HOT 1
- Can't remove keyboard shortcut from this extension HOT 1
- Need it as a npm package HOT 5
- Using author's extension in mine HOT 1
- Capturing this page results in a tall blank page HOT 8
- Multiple Scrollable elements on single page HOT 2
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 full-page-screen-capture-chrome-extension.