如何在移动Chrome上添加书签而不复制和粘贴? -- chrome-for-android 领域 和 bookmarks 领域 和 javascript 领域 和 bookmarklets 领域 android 相关 的问题

How can a bookmarklet be ADDED on mobile Chrome without copying and pasting?


简体版||繁體版
17
vote

问题

中文

在我的Android手机上,用户如何添加 bookmarklet 我的Chrome书签,无需使用其他设备,而无需复制和粘贴?
我的网站上有一个书签,我想要其他人要添加到他们的书签,所以我正在寻找一个直接的方法。

bookmarklet是书签,但其中包含JavaScript代码而不是常规Web链接。

在很多方面,可以轻松地将书签添加到PC上的Chrome。

    但是,但是,在Android上,如果Bookmarklet显示为一个链接 页面,它不能与PC一起"拖到书签栏" 。
  • 如果我尝试在新选项卡中打开它,地址栏将不包含 JavaScript,因此用户无法使用书签按钮。
  • 窃听链接到书户名称,也不会将代码放在地址栏中。
  • 我能够在我的时候添加书签的唯一方法 手机已经在链接上点击并保存,然后点击"复制链接 地址",然后编辑预先存在书签的链接和粘贴 书签代码,然后重命名书签。但这是一个痛苦,并试图向非技术解释它没有发生。

有更简单的方法吗?

请注意,我有一个特定的书签,即使在我的电脑上添加时,也不会同步我的手机的书签。我相信它可能是由于长度(它超过9000个字符!)。这就是为什么我需要一个简单的方法来保存此书本市场。

english

On my Android phone, how can a user add a bookmarklet to my Chrome bookmarks, without needing to use another device, and without copying and pasting?
I have a bookmarklet on my website that I want other people to add to their bookmarks, so I'm looking for a straightforward method.

Bookmarklets are bookmarks, but of which contain Javascript code instead of a regular web link.

Bookmarklets can be added to Chrome on the PC very easily in many ways.

  • However, on Android, if the bookmarklet is displayed as a link on a page, it cannot be "dragged to the bookmark bar" as with a PC.
  • If I try to open it in a new tab, the address bar will not contain the Javascript, so the user can't use the bookmark button.
  • Tapping the link to the bookmarklet will not put the code in the address bar either.
  • The only way I've been able to add a bookmarklet on my phone has been to tap and hold on the link, then tap "Copy link address", then edit a pre-existing bookmark's link and pasting in the bookmarklet code, then renaming said bookmark. But that's a pain, and trying to explain it to non tech savy folks isn't happening.

Is there a more simple method?

Note that I have a particular bookmarklet that even when added on my PC, does NOT sync to my Phone's bookmarks. I believe it may be due to the length (It's over 9000 characters!). This is why I need an easy method for users to save this bookmarklet.

           

回答列表

12
 
vote

您可以完全在Android Chrome中添加(和执行)书签。

警告:它需要更多的工作,而不是桌面对应物中的拖放。

保存书签(Android Chrome)

  1. 长点按所需的书签
  2. 选择 Copy Link地址
  3. 转到菜单(三个点)并点击星星(书签)
  4. 在它消失之前,点击编辑! (在底部)
  5. 删除 url 字段中的所有内容,以及类型 javascript:
    • 侧面注意:如果页面的URL真的,真的很长,你可能希望长时间点击URL内容:键盘将出现,然后立即开始键入。
  6. 长点按 javascript: ,然后点击粘贴
  7. 如果你做对的话,URL的beggining应该看起来有点像:

    javascript:(function(){lots-of-code-here...

    : 仍然存在于 javascript:

  8. name 更改为有用的东西(稍后将使用它,见下文)
  9. 可选:选择目标文件夹,您希望您想要的书签存储。
  10. 完成后,按下后​​按钮。
  11. 您可能希望测试书签。读到以下:

执行书签(android chrome)

从 how-to geek (您发送的链接):

在移动Chrome中,您需要从Location [地址]栏中启动书签。打开要运行BookMarklet的网页,点击您的位置栏,然后开始搜索书签名称。点击书签名称以在当前页面上运行它。

 

You can add (and execute) bookmarklets entirely in Android Chrome.

The caveat: it takes more work than just drag-and-drop in the desktop counterpart.

Save a bookmarklet (Android Chrome)

  1. Long tap the desired bookmarklet
  2. Select Copy link address
  3. Go to Menu (three dots) and tap the Star (bookmark)
  4. BEFORE IT DISAPPEARS, tap EDIT! (at the bottom)
  5. Erase everything in the URL field, and type javascript:
    • Side note: If the url of the page is really, really long, you might want to long tap the url contents: the keyboard will appear, and then start typing immediately.
  6. Long tap at the right of the javascript: and then tap PASTE
  7. If you did it right, the begginning of URL should look somewhat like:

    javascript:(function(){lots-of-code-here...

    (The : is still in javascript:)

  8. Change the Name to something useful (you'll use it later, see below)
  9. Optional: Pick the destination Folder where you want your bookmarklet stored.
  10. When done, press the back button.
  11. You might want to test the bookmarklet. Read below:

Execute a bookmarklet (Android Chrome)

From How-To Geek (the link you sent):

In mobile Chrome, youxe2x80x99ll need to launch the bookmarklet from the location [address] bar. Open the web page you want to run the bookmarklet on, tap your location bar, and start searching for the name of the bookmarklet. Tap the bookmarkletxe2x80x99s name to run it on the current page.

 
 
   
   
1
 
vote

如果我理解你的问题,你想要:

  1. 让用户从您自己的网站添加Bookmarklet for Android。为此,您可以使用JavaScript从这里添加书签: https://gist.github.com/oilvier/70abd45d1f2ffc98b568

    如果这不起作用,则可以使用JavaScript将BookMarklet复制到用户的剪贴板中。不是您要找的解决方案,但它删除了下面提到的用户指南中的一步。

  2. 让用户从任何网站添加书签:

    1. 长按书名标记,然后选择"复制URL"
    2. 按下右上角的3个点菜单,触摸星形。
      1. 在底部,有一个小弹出窗口,你触摸"改变"
      2. 如果弹出窗口消失得太快,请重复步骤3,这也会为您带来"更改书签" 屏幕。
    3. 长按URL下方的文本字段,然后选择"插入"
    4. 击中指向左侧的箭头。

解决方案(2)与您当前的解决方案非常相似,但您不需要桌面或预先存在的书签,因为它创建了一个新的书签。 5个简单的普通用户,特别是如果您使用屏幕截图,请帮助他们理解触摸的位置。

 

If I understand your question correctly, you want to:

  1. Let users add bookmarklets from your own website in Chrome for Android. To achieve this, you could use JavaScript to add a bookmark from here: https://gist.github.com/oilvier/70abd45d1f2ffc98b568

    If this does not work, you could use JavaScript to copy the bookmarklet into the user's clipboard. Not really the solution you're looking for, but it removes one step in the user guide mentioned below.

  2. Let users add bookmarklets from any website:

    1. Long press on the bookmarklet and select "Copy URL"
    2. Press on the 3 dot menu on the upper right and touch the star.
      1. At the bottom, there is a small popup where you touch "Change"
      2. If the popup disappeared too fast, repeat step 3 which brings you to the "Change bookmark" screen too.
    3. Long press on the text field below URL and then choose "Insert"
    4. Hit the arrow pointing to the left.

Solution (2) is very similar to your current solution, but you don't need a desktop or a pre-existing bookmark as it creates a new one. 5 easy steps for average users, especially if you use screenshots to help them understand where to touch.

 
 
0
 
vote

chrome android不允许您运行传统方式的书签,但是,有一个解决方法,可以从地址栏调用BookMarklet,

首先,您必须通过编辑它来手动创建一个书签,

例如, javascript:alert('foo'); 并命名它。

然后,在要运行的页面上,搜索地址栏中的书签名称,然后单击它。

bookmarklet在android

下面的教程可能会有所帮助。

https://paul.kinlan.me/use- Bookmarklets-on-chrome-on-android /

 

Chrome Android doesn't let you run Bookmarklets the traditional way, But, there is a workaround, you can call Bookmarklet from the address bar,

First, you have to manually create a Bookmarklet by editing it,

For example, javascript:alert('foo'); and name it.

Then, on the page you want to run this, search for the bookmarklet name in the address bar, and click on it.

Bookmarklet on Android

Below Tutorial might be helpful.

https://paul.kinlan.me/use-bookmarklets-on-chrome-on-android/

 
 
   
   
-1
 
vote

这是一个简单的解决方案。

  1. 将Chrome上的Chrome保存在桌面上的Chrome给它一个名称,例如BM1
  2. 在桌面和移动Chrome浏览器中的Chrome浏览器上转动同步。当同步打开时,所有书签和书签也会传输到手机。
  3. 现在,这应该使我们的书签在移动Chrome浏览器中可访问。以下是如何执行BookMarklet:在搜索栏中键入BookMarklet BM1的名称。而且,Google Chrome将根据您在地址栏上键入的内容给您建议,并将有您的书签。现在,只需单击"书签" 只需单击"计算机" 。
 

Here is an easy solution.

  1. Save the bookmarklet on Chrome on your desktop give it a name, say, BM1
  2. Turn sync on the chrome browser in both desktop and mobile Chrome browsers. When the sync is on, all the bookmarks and bookmarklets gets transferred to the mobile phone as well.
  3. Now, this should make our bookmarklet accessible in the mobile chrome browser. Here is how to execute the bookmarklet: Type the name of the bookmarklet BM1 in the search bar. And, google chrome will give you suggestion based on what you type on the address bar and there will be your bookmarklet. Now, simply click the bookmarklet once you see it.
 
 
 
 

相关问题

17  如何在移动Chrome上添加书签而不复制和粘贴?  ( How can a bookmarklet be added on mobile chrome without copying and pasting ) 
在我的Android手机上,用户如何添加 bookmarklet 我的Chrome书签,无需使用其他设备,而无需复制和粘贴? 我的网站上有一个书签,我想要其他人要添加到他们的书签,所以我正在寻找一个直接的方法。 bookmarklet是书签,但其中包含JavaScript代码而不是常规Web链接。 在很多方面,可...

3  如何保存“JavaScript:”在Android浏览器中的网址?  ( How do i save javascript urls in androids browser ) 
我已经尝试了点击&保持,如常规网址,但菜单永远不会弹出。有没有办法启用它或者我只需要将URL复制并粘贴到书签中(喜欢这个)? 这是我试图使用的页面: http://www.delicious.com/help/bookmarklet ...

1  是否可以通过从书签中选择它来在Chrome上运行书签?  ( Is it possible to run a bookmarklet on chrome by selecting it from the bookmark ) 
我正在使用chrome for Android。如果我有一个书签保存为书签,那么我可以通过以下方式运行: 在地址栏中键入其名称,直到它显示。 单击它旁边的向上向左指向对角线箭头将其加载到地址栏中。 单击enter。 我是不是能够运行一份书签,我已保存为书签: 打开Chrome垂直对齐的三点菜单。 选择 Book...

7  有没有办法使用PC浏览器书签使用Android浏览器或海豚HD?  ( Is there a way to use pc browser bookmarklets with the android browser or dolphi ) 
我可以在Android上做出这些工作,还是有没有谷歌地点来创建或转换书签,以使它们兼容Android? ...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有