Closed Bug 1340774 Opened 9 years ago Closed 9 years ago

Google bookmarket shortcut does not work inside github.com due to CSP

Categories

(Core :: DOM: Security, defect)

51 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 866522

People

(Reporter: 2bedros, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0 Build ID: 20170125094131 Steps to reproduce: have a google (gmail.com) account go to https://www.google.com/bookmarks/ and drag "Google Bookmark" shortcut to browser's bookmark nav bar. now, go to any website and click on "Google Bookmark" on the bar, and it will show you a new window to enter the bookmark info now, go to github and select a random project, then click on the same "Google Bookmark" shortcut and nothing happens. Actual results: no bookmark window shows on github.com Expected results: bookmark javascript shortcut works on any other website, the bookmark window should show.
Can you copy the URL of your bookmark "Google Bookmark". And a screenshot.
Flags: needinfo?(2bedros)
(In reply to Loic from comment #1) > Can you copy the URL of your bookmark "Google Bookmark". And a screenshot. I don't understand your question. the content of the navbar shortcut which is copied from google.com/bookmarks after drag-drop the link is as follows """ javascript:(function(){var a=window,b=document,c=encodeURIComponent,d=a.open("https://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk="+c(b.location)+"&title="+c(b.title),"bkmk_popup","left="+((a.screenX||a.screenLeft)+10)+",top="+((a.screenY||a.screenTop)+10)+",height=510px,width=550px,resizable=1,alwaysRaised=1");a.setTimeout(function(){d.focus()},300)})(); """ this would work on any website but github.com please fix this as I find myself using chrome on github since the above works on chrome with no problem.
When using the bookmarklet on a Github page (like https://github.com/mozilla/mozregression ), the console displays the error: Content Security Policy: The page’s settings blocked the loading of a resource at self (“script-src https://assets-cdn.github.com”).
Component: Untriaged → DOM: Security
Flags: needinfo?(2bedros)
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Summary: Google bookmark shortcut does not work inside github.com → Google bookmarket shortcut does not work inside github.com due to CSP
This is a dupe from the early days
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.