Giter Site home page Giter Site logo

wingleung / save-page-state Goto Github PK

View Code? Open in Web Editor NEW
228.0 8.0 12.0 997 KB

A chrome extension to save the state of a page for further analysis

License: MIT License

JavaScript 100.00%
chrome-extension mhtml screenshot analysis devtools snapshot state

save-page-state's Introduction



Save Page State

Save Page State



A browser extension to save the state of a page for further analysis

Chrome Web Store Software License

Highlights

Install

Install the extension from the chrome web store or firefox add-ons.

Or create a custom extension with this repo with limited access permission

Customize

Restrict Access Permission

In manifest.json (/src/manifest.json), replace <all_urls> with your own project URL pattern you wish to save the page states from.

{
	...
	"content_scripts": [
		{
			"matches": ["<all_urls>"], // <- change this to your url pattern
			"js": ["js/content.js"]
		}
	],
	"permissions": ["activeTab", "pageCapture", "<all_urls>"]  // <- change this to your url pattern
	...
}

Install dependencies

npm i

Build

npm run build

Builds to /build/prod

Publish

Chrome

Create a zip file from /build/prod/chrome upload it to the chrome web store.

Firefox

Create a zip file from /build/prod/firefox upload it to the firefox developer hub.

Development

npm run dev:chrome // builds to /build/dev/chrome
npm run dev:firefox // builds to /build/dev/firefox

Features

DOM Snapshot

An HTML file containing the state of the DOM.

MHTML file (chrome only for now)

Note Firefox doesn't support saving an MHTML file natively yet.

An MHTML page with encapsulated resources, so you could immediately check the layout by opening the MHTML file in Chrome.

Screenshot

A PNG image of the viewport.

Metadata

Text file with extra metadata useful for debugging with the exact same state.

  • height: viewport height
  • width: viewport width
  • incognito: is page loaded in incognito mode
  • status: page loading status
  • title: page title
  • url: page URL
  • browser: browser
  • browserVersion: browser version
  • os: operating system

Maintainer

Wing Leung

save-page-state's People

Contributors

wingleung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

save-page-state's Issues

Create a better developer setup

There's some duplication going on.

Might be better to look into either improving the current setup or using a boilerplate setup

Another page saving concept

I believe there is other way to save page with current state, the page is saved as HTML, and consisting these methods:

  • Compile image as base64, then embedded as data URI
  • Store <iframe> content as srcdoc attribute
  • Insert style sheets and scripts into <style> and <script> tags respectly

So WDYT?

Need better naming

It seems that does not save 'state' in a page.
I think dom-snapshot or dom-capture or something looks better.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.