README.md in onebox-1.9.30 vs README.md in onebox-2.0.0
- old
+ new
@@ -69,16 +69,15 @@
out the project. You can then try out URLs.
The server doesn't reload code changes automatically (PRs accepted!) so
make sure to hit CTRL-C and restart the server to try a code change out.
-
Adding Support for a new URL
----------------------------
1. Check if the site supports [oEmbed](http://oembed.com/) or [Open Graph](https://developers.facebook.com/docs/opengraph/).
- If it does, you can probably get away with just whitelisting the URL in `Onebox::Engine::WhitelistedGenericOnebox` (see: [Whitelisted Generic Onebox caveats](#user-content-whitelisted-generic-onebox-caveats)).
+ If it does, you can probably get away with just allowing the URL in `Onebox::Engine::AllowlistedGenericOnebox` (see: [Allowlisted Generic Onebox caveats](#user-content-allowlisted-generic-onebox-caveats)).
If the site does not support open standards, you can create a new engine.
2. Create new onebox engine
``` ruby
@@ -162,19 +161,26 @@
``` ruby
# in lib/onebox/engine.rb
require_relative "engine/name_onebox"
```
-
-Whitelisted Generic Onebox caveats
+Allowlisted Generic Onebox caveats
----------------------------------
-The Whitelisted Generic Onebox has some caveats for its use, beyond simply whitelisting the domain.
+The Allowlisted Generic Onebox has some caveats for its use, beyond simply allowlisting the domain.
- 1. The domain must be whitelisted
+ 1. The domain must be allowlisted
2. The URL you're oneboxing cannot be a root url (e.g. `http://example.com` won't work, but `http://example.com/page` will)
3. If the oneboxed URL responds with oEmbed and has a `rich` type: the `html` content must contain an `<iframe>`. Responses without an iframe will not be oneboxed.
+Ignoring Canonical URLs
+-----------------------
+
+Onebox prefers to use canonical URLs instead of the raw inputted URL when searching for Open Graph metadata. If your site's canonical URL does not have opengraph metadata, use the `og:ignore_canonical` property to have Onebox ignore the canonical URL.
+
+```html
+<meta property="og:ignore_canonical" content="true" />
+```
Installing
----------
Add this line to your application's Gemfile: