Giter Club home page Giter Club logo

whatfont-bookmarklet's Introduction

WhatFont

WhatFont is a JavaScript script to detect what font in the stack is being used on any elements of a web page.

Here in the repo is the core component with out wrappers, the wrapped Chrome/Safari extensions are available at http://chengyinliu.com/whatfont.html.

How to Use

whatfont_core.js is the core script. It adds _whatFont() into the global scope. WhatFont then runs in a closure created by the _whatFont() function.

An controller object is returned by whatFont() function. The controller will be used to set up the dependencies (jQuery and stylesheet) and initialize WhatFont.

This controller has the following functions:

  • setJQuery(jQ)

    WhatFont requires jQuery (v1.5.2), if jQuery has already been loaded into the global scope, the script finds it automatically. Otherwise setJQuery(jQ) needs to be called to set up jQuery object.

  • setCSSURL(url)

    WhatFont injects its stylesheet file into the webpage. The script comes with a default URL setting, if you want to change the setting, calling this function.

  • getVer()

    Return the version of WhatFont.

  • init()

    Initialize WhatFont and inject to the current document.

  • restore()

    Remove WhatFont from current document.

Example

wf = _whatFont();		
wf.setjQuery(jQuery);		// Setup jQuery
wf.init();					// Load WhatFont
wf.restore();				// Remove WhatFont

whatfont-bookmarklet's People

Contributors

allmarkedup avatar bennettmcelwee avatar chengyin avatar riobard 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatfont-bookmarklet's Issues

Safari 8 NOT Functioning/Broken

This plugin no longer works with Safari 8.0.2 (current version) — plugin button appears after install clicking the button no longer does anything.

If you'd like to send me a PM and I'd be happy to test/troubleshoot for you in the case that you do not have access to Safari.

Https support

Would be nice to have the bookmarklet not load http content.

Safari Extension Marked as Unsafe by Safari 12

After updating my Safari to version 12.0, the browser kicked this extension out citing it’s “unsafe” and “not coming from the Safari Extension Gallery”. Would you mind looking into this?

Keyboard Shortcut not working

My Google Chrome is Version 50.0.2661.94 (64-bit) (Mac)

I set up different key bindings on chrome://extensions/configureCommands dialog, none of them work.

I tried key bindings on different other extensions, and they work as expected, so nothing else is 'catching' the keys.

Retina icon needed

Possible to update the icon for extensions to be retina? Looks dated and rough on a rMBp or riMac.

Thanks! 👍

iframe fail

Thanks for this. Very clever and useful. This is something the various Dev Tools Inspectors should really implement natively. Congrats on beating them to it!

One issue: In chrome 21, the plugin doesn't work on text inside an iframe. No bubble pops up at all. Try inspecting the results pane here:

http://jsfiddle.net/Wsmfv/

Any fix greatly appreciated.

Add a toggle for font-weight and font-size properties

In the options, add the ability to toggle font-weight and font-size properties.
Or alternatively, support all the following font properties:

  1. font-weight
  2. font-size
  3. font-style
  4. font-variant
  5. color
  6. letter-spacing
  7. line-height

any interest in porting to Firefox (as an add-on)?

It'd be great to use this in the main add-on area of the nav bar rather than the bookmarks bar.

Any interest in getting that working on Firefox? Asking before I start looking at that in case others already have.

Error message displayed in developer tools when extension is activated

Hi there,
Thanks for the extension, it's doing a great job.

However, as soon as I activate the extension and I load a page I get an error displayed on the developer-console:
Unchecked runtime.lastError: The message port closed before a response was received.

How to reproduce

  1. Open e.g. this link with activated extension: https://www.google.com/search?q=test
  2. There should be the error in the console.
  3. Deactivate the extension and reload the page or open it once again.
  4. No error is displayed in the console.

Doesn't detect correct font

Running ZURB Foundation v6 the font family is:

Helvetica Neue,Helvetica,Roboto,Arial,sans-serif

Using Win10, chrome 48+

WhatFont reports the font rendered is "Helvetica" however neither Microsoft Word nor control panels fonts can find Helvetica. Chrome is reporting Arial is rendered.

License

What license is this released under? :-)

Not working on Firefox 53.0 (64-bit)

I have re-added the bookmark but once I load a site and try it, nothing happens...

Here is what shows in the bookmark:

javascript:(function(){var%20d=document,s=d.createElement('scr'+'ipt'),b=d.body,l=d.location;s.setAttribute('src','http://chengyinliu.com/wf.js?o='+encodeURIComponent(l.href)+'&t='+(new%20Date().getTime()));b.appendChild(s)})();

Any ideas?

I did see the issue where you notated that it only works on actual web-sites so I made sure I tried it on a few; https://www.mozilla.org/en-US/ being the last one I tried.

Dynamic updating

What do you think it would take to make the bookmarklet update dynamically, when values were changed in the DOM inspector?

Error in event handler

This error is raised when using in Chrome v53.x:

Error in event handler for extension.onRequest: TypeError: Cannot read property 'indexOf' of undefined
at HTMLLinkElement. (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:8:293)
at Function.each (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/jquery.min.js:2:11776)
at each (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/jquery.min.js:2:8304)
at Object.google (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:8:246)
at Object.init (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:7:178)
at Object.init (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:24:3)
at s (chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:29:492)
at chrome-extension://jabopobgcpjmedljpbcaablpmlmfcogm/wf_chrome.js:30:107

Publish your extension to Microsoft Edge Addons website

Microsoft Edge is the second most used browser on the web, making the browsing experience more flexible, offering many more services for users and optimized for Windows devices.

Microsoft Edge supports Chromium extensions, and you can publish your extensions to Microsoft Edge Add-ons website with minimal code changes. Find out more here.

If you have any more queries about porting Chrome extension to Microsoft Edge or anything else, you can contact the relevant teams whose links are given here.

Let me know if this was helpful. I am happy to help you with more details.

Link to the typekit / google web fonts page

It would be nice if the title linked to the typekit /google fonts webpage for immediate use.

I.e. I see a font I like, I click the link, and am almost immediately able to include the font in my own project. Is this feasible?

Can't view font in very simple pages

I did write a tweet referencing a JSFiddle, but I suspect that's just an iframe issue. My issue occurs without an iframe. With the following HTML:

<!DOCTYPE html>
<html>
    <head>
        <title>
        </title>
        <link href="cursive.css" rel="stylesheet">
    </head>
    <body>
        <span class="cursive">what font am I, whatfont?</span>
    </body>
</html>

And the following stylesheet:

span {
    font-family: Cursive;
    border: 1px solid green;
}

I can't start whatfont, clicking the icon doesn't do anything.

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.