Guest User

Untitled

a guest
Jan 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. {
  2.  
  3. "manifest_version": 2,
  4. "name": "FireWindowSize",
  5. "version": "1.0",
  6.  
  7. "description": "Shows Window Size when resizing the window.",
  8.  
  9. "icons": {
  10. "48": "resize.png"
  11. },
  12.  
  13. "content_scripts": [
  14. {
  15. "matches": ["*://*/"],
  16. "js": ["windowsize.js"]
  17. }
  18. ]
  19.  
  20. }
  21.  
  22. $(document).ready(function(){
  23. var MEASUREMENTS_ID = 'measurements'; // abstracted-out for convenience in renaming
  24. $("body").append('<div id="'+MEASUREMENTS_ID+'"></div>');
  25. $("#"+MEASUREMENTS_ID).css({
  26. 'position': 'fixed',
  27. 'bottom': '0',
  28. 'right': '0',
  29. 'background-color': 'black',
  30. 'color': 'white',
  31. 'padding': '5px',
  32. 'font-size': '10px',
  33. 'opacity': '0.4'
  34. });
  35. getDimensions = function(){
  36. return $(window).width() + ' (' + $(document).width() + ') x ' + $(window).height() + ' (' + $(document).height() + ')';
  37. }
  38. $("#"+MEASUREMENTS_ID).text(getDimensions());
  39. $(window).on("resize", function(){
  40. $("#"+MEASUREMENTS_ID).text(getDimensions());
  41. });
  42. });
Add Comment
Please, Sign In to add comment