Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "manifest_version": 2,
- "name": "FireWindowSize",
- "version": "1.0",
- "description": "Shows Window Size when resizing the window.",
- "icons": {
- "48": "resize.png"
- },
- "content_scripts": [
- {
- "matches": ["*://*/"],
- "js": ["windowsize.js"]
- }
- ]
- }
- $(document).ready(function(){
- var MEASUREMENTS_ID = 'measurements'; // abstracted-out for convenience in renaming
- $("body").append('<div id="'+MEASUREMENTS_ID+'"></div>');
- $("#"+MEASUREMENTS_ID).css({
- 'position': 'fixed',
- 'bottom': '0',
- 'right': '0',
- 'background-color': 'black',
- 'color': 'white',
- 'padding': '5px',
- 'font-size': '10px',
- 'opacity': '0.4'
- });
- getDimensions = function(){
- return $(window).width() + ' (' + $(document).width() + ') x ' + $(window).height() + ' (' + $(document).height() + ')';
- }
- $("#"+MEASUREMENTS_ID).text(getDimensions());
- $(window).on("resize", function(){
- $("#"+MEASUREMENTS_ID).text(getDimensions());
- });
- });
Add Comment
Please, Sign In to add comment