Fix bookmarklet URL (fix #90 and #89)

This commit is contained in:
Pierre Rudloff 2017-01-16 01:57:44 +01:00
parent 686a0896f8
commit d1e744e42c
2 changed files with 3 additions and 1 deletions

View File

@ -80,6 +80,7 @@ class FrontController
*/
public function index(Request $request, Response $response)
{
$uri = $request->getUri();
$this->view->render(
$response,
'index.tpl',
@ -88,6 +89,7 @@ class FrontController
'uglyUrls' => $this->config->uglyUrls,
'class' => 'index',
'description' => 'Easily download videos from Youtube, Dailymotion, Vimeo and other websites.',
'domain' => $uri->getScheme().'://'.$uri->getAuthority(),
]
);
}

View File

@ -28,7 +28,7 @@
<a class="combatiblelink" href="{path_for name="extractors"}">See all supported websites</a>
<div id="bookmarklet" class="bookmarklet_wrapper">
<p> Drag this to your bookmarks bar: </p>
<a class="bookmarklet" href="javascript:window.location='{base_url|noscheme}{path_for name='video'}?url='+encodeURIComponent(location.href);">Bookmarklet</a>
<a class="bookmarklet" href="javascript:window.location='{$domain}{path_for name='video'}?url='+encodeURIComponent(location.href);">Bookmarklet</a>
</div>
</div>