有没有办法通过 javascript bookmarklet 将 currentURL 中最后一个反斜杠之后的所有字符替换为另一个字符串?
我正在对 Sharepoint 网站进行大量审核工作,并且必须通过在 URL 末尾输入字符串来手动查看网站的设置页面。例如,我可能会访问如下网站:
https://site.com/... ./default.aspx
我将“default.aspx”替换为“_layouts/user.aspx”并重新加载新页面,使其现在位于:
https://site.com/..../_layouts/user.aspx
它并不总是“default.aspx”,所以我不能只使用简单的字符串替换。我知道有一种方法可以通过 javascript 书签来操作 URL,但我对如何做到这一点的了解最多是有限的。任何帮助或指导将不胜感激
Is there a way to replace all characters after the last backslash in the currentURL with another string via javascript bookmarklet?
I'm doing a lot of auditing work with Sharepoint sites and having to manually look at the settings pages for sites by entering strings to the end of a URL. For example, I might go to a site like:
https://site.com/..../default.aspx
And I replace the "default.aspx" with "_layouts/user.aspx" and reload the new page so it is now at:
https://site.com/..../_layouts/user.aspx
It's not always "default.aspx", so I can't just use a simple string replace. I know there is a way to manipulate the URL via a javascript bookmarklet, but my knowledge of how to do that is limited at best. Any help or guidance would be greatly appreciated
发布评论
评论(1)
我不知道这是否是您的想法,但如果您只想用其他内容更改网址的最后一部分,您可以使用此书签
您可以将固定网址替换为
如果您需要每次更改最后一部分, 时间。
我希望这有帮助。
I don't know if this is what you thought, but if you just want to change the last part of the url with something else, you could use this bookmarklet
You could replace the fixed url with
if you need to change the last part each time.
I hope this helps.