GithubHelp home page GithubHelp logo

edlea / desktopamp Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 8.0 85 KB

Safari and Chrome extensions to load the AMP version of webpages if available

License: MIT License

JavaScript 63.69% Makefile 36.31%

desktopamp's People

Contributors

dieseltravis avatar edlea avatar paulirish avatar rkallenkoot 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

desktopamp's Issues

Setting max-width doesn't always work correctly.

Example URL (scroll to the bottom): http://www.buzzfeed.com/amphtml/ailbhemalone/things-i-wish-id-known-about-money-in-my-twenties

What is happening is the list on the bottom sets the following style: margin-right: 0.5rem which is overriding the margin: 0 auto. One hacky way to "fix" it is to set margin: 0 auto !important but I think the real right way to fix this is to create a container and hoist all the content of the body into the container and set the container's max width to 600px. That way any margins set by the original site will work correctly.

License?

I'd like to us some of your code for my extension - what license are you under?

Consider removing applyMobileCSS?

Applying the mobile CSS (600px, etc), while well-intended, breaks pages. Attached are some screen shots from Backchannel (which is published on Medium).

I feel that getting this right is any sort of universal way is unlikely, will cause regressions, and so the extension shouldn't do it. Thoughts? Thanks.

Header busted:

screen shot 2016-10-05 at 10 28 24 am

### Text cut off on right

screen shot 2016-10-05 at 10 28 32 am

### Original, without applyMobileCSS:

screen shot 2016-10-05 at 10 26 17 am

Faster initialization

so we need to read the <head> and thus document_start won't work as a trigger.

but it feels like document_end is a bit too late.

One approach that might work

in document_start, set up a mutationobserver, observe the documentElement, and when it adds a node, see if its the head, then querySelector in that for our amp guy.

ideally that'd get things rolling faster than waiting for all of to finish.

a bit more complicated but probably worth it, wdyt?

Add default zoom per AMP domain

on high resolution laptop screens, the AMP content is often small, it would be great if I could set e.g. BBC 150%, Reuters 140% etc.

Add Ability To Blacklist Domains/URL Paths

I'm really digging this extension, as it cuts the load time on a lot of my favorite websites. My only wish is that it could be a little more configurable. For example, I really dislike Genius's AMP site and would love to blacklist it from redirecting to the AMP version. Similarly, I love how this extension cuts down the bloat on Huffington Post articles, but for some of the articles, this extension causes a redirection loop when you click on the articles on the left (the articles in the middle aren't effected, for whatever reason).

If there could be blacklisting support built in to this extension that turns off AMP redirection for specified sites via a regex, that would be fantastic.

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.