Greasy Fork is available in English.

Embed Me!

An userscript to embed video, images from links.

目前為 2015-10-06 提交的版本,檢視 最新版本

作者
eight
評價
0 0 0
版本
0.2.1
建立日期
2015-06-18
更新日期
2015-10-06
相容性
相容於 Firefox 相容於 Chrome 相容於 Opera
授權條款
MIT
腳本執行於
所有網站

Embed Me!

An userscript to embed videos, images from anchor link.

Demo

Demo page

Supported sites

Checkout the module folder. It is welcome to contribute more modules.

Module

A module object should look like:

{
    name: "The module name",
    global: true,               // The module should work globally,
    domains: ["example.com"],   // or the module will only work on these domains.
    getPatterns: function() {
        // Return a list of regex object. Only matched urls will be sent to embed function.
        return [
            // ...
        ];
    },
    getEmbedFunction: function() {
        // Return an embedding function.
        //
        // Params:
        //   1...n  The capturing groups returned by regex pattern. n = groups.length.
        //   n+1    The url of the link.
        //   n+2    The text content of the link.
        //   n+3    The link itself.
        //   n+4    A replace function.
        //
        // Usually you can return new element back. If you have to replace element asynchronously,
        // send new element to replace function when you are finished.

        return function (url, text, node, replace) {
            // ...
        }
    }
}

Known issues

Some online embedding service

Changelog

  • 0.2.1 (Oct 6, 2015)
    • Support more patterns in youtube module.
  • 0.2.0 (Jun 18, 2015)
    • Update GM_config.
    • Fix image max-width.
    • Fix imgur iframe.
    • Fix youtube bug.
  • 0.1.1 (Jun 17, 2015)
    • Add @noframes.
  • 0.1.0 (Jun 17, 2015)
    • First release.