Posts

Post not yet marked as solved
1 Replies
1.3k Views
My existing chrome extension has "Sign in with Apple" given that we have iOS users. When user clicks "Continue with Apple" button in the extension log in pop up, this is what we do: javascript window.open( 'https://appleid.apple.com/auth/authorize?client_id=' + clientID + '&redirect_uri=' + backEndURL + '&response_type=id_token%20code&response_mode=form_post&scope=email%20name', 'Sign in with Apple', 'height=500,width=400,left=600,top=200,status=no,location=no,toolbar=no,menubar=no' ) In chrome, this opens a popup window with that URL. In Safari Converted Web Extension, it opens custom Apple sign in flow, where it says: "Do you want to sign in to *** with your Apple ID YYY?" and then with my mac password I'm able to authenticate. Afterwards, nothing happens. Expected: a redirect to the URL specified in the window.open. Now let's do a trick: I'll wrap the above window.open code into javascript setTimeout (() = {window.open (...)}, 3000) Because of security reasons, safari then won't open the popup after 3s and will display a notification in the toolbar "Popup blocked..". If we allow the popup, then it finally opens as a normal window popup and after sign in, it redirects to our backend and it successfully authenticates. Any ides what how to solve this? P.S. We're not able to use embedded Sign in with Apple JS - https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple script because we can't host a remote code in the extension (it will be deprecated soon). So, we arere using this. - https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms
Posted
by climb.
Last updated
.
Post marked as solved
3 Replies
1.4k Views
I'm trying to convert an existing Chrome Extension to Safari Web Extension using this converter - https://developer.apple.com/documentation/safariservices/safari_web_extensions/converting_a_web_extension_for_safari. Immediately after convert, xcode opens and I build the project with my developer certificate. Everything looks perfect in Safari: the popup works fine, the context menu item is there, options are there. The moment I restart Safari OR rebuild the project (even without changes), the context menu item disappears. This is how context menu is defined in my context.js script: chrome.runtime.onInstalled.addListener(function() { &#9;&#9;chrome.contextMenus.create({ &#9;&#9;&#9;&#9;"title": chrome.i18n.getMessage("contextMenu"), &#9;&#9;&#9;&#9;"contexts": ["selection"], &#9;&#9;&#9;&#9;"id": "context" + "selection" &#9;&#9;}); }); chrome.contextMenus.onClicked.addListener(onClickHandler); My manifest.json has this: "permissions": ["activeTab", "storage", "contextMenus"], I followed these instructions - https://developer.apple.com/documentation/safariservices/safari_app_extensions/safari_app_extension_info_property_list_keys/about_contextual_menu_and_toolbar_item_keys and added this key to info.plist in the folder "ProjectName Extension": <key>SFSafariContextMenu</key> &#9;&#9;&#9;&#9;&#9;&#9;<array> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;<dict> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;<key>Text</key> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;<string>Context Menu Text</string> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;<key>Command</key> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;<string>commandMenu</string> &#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;</dict> &#9;&#9;&#9;&#9;&#9;&#9;</array> After rebuilding the project, nothing changed. Any ideas how to make context menu consistent?
Posted
by climb.
Last updated
.