Safari and Web

RSS for tag

Enable web views and services in your apps.

Posts under Safari and Web tag

159 Posts
Sort by:
Post not yet marked as solved
0 Replies
64 Views
I have one web viewer in React Native for my app, and the function of translate with Google works perfectly in the Safari browser, in my Android App, and on the desktop, but not in the iOS app This is my Google Translate code: function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'pt', includedLanguages: 'pt,en,es', layout: google.translate.TranslateElement.InlineLayout.HORIZONTAL }, 'google_translate_element'); comboTranslate = document.querySelector("#google_translate_element .goog-te-combo"); } function changeEvent(el) { if (el.fireEvent) { el.fireEvent('onchange'); } else { // var evObj = document.createEvent("HTMLEvents"); var event = new Event('change'); comboTranslate.dispatchEvent(event); // evObj.initEvent("change", false, true); // el.dispatchEvent(evObj); } } function changeLang(lang) { if (comboTranslate) { comboTranslate.value = lang; changeEvent(comboTranslate); } } function clickChange(){ btn_translate = document.querySelectorAll('.language'); // o que faz os menus acender; btn_translate.forEach(btn => { btn.addEventListener('click', function (e) { var lang = e.srcElement.getAttribute('data-language'); changeLang(lang) }) }) } clickChange(); setTimeout(() => { googleTranslateElementInit() // comboTranslate.addEventListener('change', function (e) {alert('a');}) }, 500); and on the app.json I have: { "expo": { "name": "MyApp ", "slug": "MyApp", "version": "1.2.0", "orientation": "portrait", "icon": "./assets/icon.png", "locales": { "en": "./locales/ios/en.json", "pt": "./locales/ios/pt.json", "es": "./locales/ios/es.json" }, "platforms": [ "ios", "android" ], "splash": { "image": "./assets/splash.png", "resizeMode": "contain", "backgroundColor": "#ffffff" }, "plugins": [ [ "expo-notifications", { "icon": "./assets/icon.png", "color": "#ffffff" } ] ], "updates": { "fallbackToCacheTimeout": 0 }, "assetBundlePatterns": [ "**/*" ], "ios": { "buildNumber": "8", "supportsTablet": true, "bundleIdentifier": "com.myapp", "infoPlist": { "CFBundleAllowMixedLocalizations": true } }, "android": { "package": "com.myapp", "versionCode": 9, "googleServicesFile": "./google-services.json", "config": { "googleMaps": { "apiKey": "AIzaSyDQjE4F3chI8Jy4FA8h45LqA7bMfngoH7Y" } }, "permissions": ["ACCESS_COARSE_LOCATION", "ACCESS_FINE_LOCATION", "CAMERA", "RECORD_AUDIO"], "blockedPermissions": ["ACCESS_BACKGROUND_LOCATION"], "adaptiveIcon": { "foregroundImage": "./assets/adaptive-icon.png", "backgroundColor": "#FFFFFF" } }, "notification": { "icon": "./assets/icon.png" } } } I put console.log and alerts to see if the change in the select element of languages is being triggered by the JS, and it's all ok, I really don't know why it is not translating.
Posted
by
Post not yet marked as solved
1 Replies
80 Views
Hello, We are running a complex web application built with React and related ecosystem. this web application is essentially a PWA and it is offline first. So, It relies heavily on service worker, indexDB database, cache storage, local storage etc. We are running this web application inside a WKWebView which resides in a native iOS App. We have noticed that WKWebView is highly unreliable when it is running such a complex web app. some of the behaviours noticed are only blank screen is shown with no content loaded from the url when url is pointed to different location (say uat, qa, prod environments) in the same wkwebview at run time, it causes data corruption as part of indexdb. it seems that it is not keeping different sets of data for different urls. when registering newer version of service workers, wkwebview errors out and can not proceed with new registrations does not always show a target page when a react app programmatically navigates to different locations within the web app. I am interested in knowing from fellow iOS developers that have you previously experienced above with WKWebView? is WKWebView a good option for running such a web application or SFSafariView is the better alternative? thank you Dilip
Posted
by
Post not yet marked as solved
1 Replies
156 Views
I have used Safari as my primary browser for years now and it has evolved. Some very good updates and some bad. I have noticed since iOS 14 I believe when Apple started slowly implementing more security features that pages would show up wonky or unresponsive at times, but a clear browsing history and cookies would fix this issue. Then in iOS 15 and now 16b1 it’s become almost unusable on certain pages.  Again these issues have been ongoing since the updated security features started rolling out and in non beta releases For example. Some pages won’t load completely or when you try to use a drop down menu the pictures would overlap the drop down. Resets or clearing cookies/cache, history would not fix this issue. Even turning off some of the privacy features wouldn’t resolve this. Menus have become unresponsive, ie. registering a new user on a forum. The menus would are static with no way to change or update your dob or address.  I hope this makes sense so far. So here is what I have turned on and added extensions. Tracking is off in privacy & security [on] Block pop ups [on] Prevent cross-tracking [on] Hide IP and Address - Trackers & Websites // I can’t see it but I believe the Trackers & Websites is set to general location// [on] Fraudulent website warnings [on] Privacy Preserving Ad Measurements  All Advanced Safari settings are default and have not been touched  Extensions - 1Blocker (only these below are on) [on] Block Ads [on] Block Adult Sites [on] Block Annoyances [on] Block Trackers I have tested things for months now, toggling these off and back on. Trying to find the combination that works. I even removed all extensions and ran just the safari settings by themselves and it still renders some type of misfire with sites (menus being static or pictures over lapping drop down menus) The title says it all. How can I get safari back to working and have these privacy features on without the extra bugginess that Safari is doing? Thanks in advance!
Posted
by
Post not yet marked as solved
0 Replies
130 Views
I'm developing a REST API app that generates some PDFs for my users, but there are only available for a certain period of time. To download them I'm using the a HTML tag: <a href="/api/items/1/generate?type=register" download="Important Letter.pdf"> <svg>...</svg> </a> This works fine in the normal flow of the use case, but if a user request a PDF outside of the download period, the server responds to the request with a 422 (Unprocessable Entity) HTML code, and place a json on the body of the request: HTTP/1.1 422 Unprocessable Entity Content-Type: application/json;charset=utf-8 {"error" : "Registration period expired", "type" : "expired", "data" : {"id" : 1}} Safari does not interpret this error and it generates the Important Letter.pdf file and writes the json content on it. Is there a wat to avoid this behavior and display an error message to the user? I was wondering if my server should send some specific error code.
Posted
by
Post not yet marked as solved
0 Replies
157 Views
I have the websocket server which enables permessage-deflate to compress massive data. The problem is when I try to use it in webview, the connection was closed. I learned from other discussion that it can be solved by disabling Setting safari =>Advanced=>Experimental Features=>NSURLSession WebSocket, but only for Safari. How can I solve the problem in WKWebview? Or when will the problem be solved?
Posted
by
Post not yet marked as solved
1 Replies
228 Views
Date objects should be able to be constructed with strings formatted as YYYY-MM-DD . On Chrome-based browsers, both of the following are valid: new Date("2022-06-01") new Date("2022-6-01") although the second one does not strictly follow the format. However, it is extremely convenient to work with since you do not have to check for the string length and determine whether to add a 0 in the beginning. Yet, on my Safari browser, the code: new Date("2022-6-01") returns a date object of an invalid date. This is simple to fix, yet it poses an inconvenience during development. Is there any way to let Apple improve its JavaScript engine?
Posted
by
Post not yet marked as solved
0 Replies
214 Views
I am using iPhone 8 Plus, IOS version 15.4.1, browser is Safari I played an audio in an audio playlist, when the audio is end it will automatically play the next track of the audio playlist. It will work fine if iPhone screen is not locked. But when the screen is locked, the audio will not play next track. Here is an example link: http://relaxinglive.com/album.php?id=1 Open this link, choose a song. Wait to the end of audio, if the screen is locked then the audio player will not play next track. Note: The issue only happens in my iPhone, It doesn't happen on my MacBook. The issue happen when my iPhone update version to 15.4.1 (the issue doesn't happen before) Is it possible to make the browser play next audio track when screen locked?
Posted
by
Post marked as solved
2 Replies
337 Views
Hi, I have a WebView based app, I want any external links within the default website in the WebView to open in a new Safari browser tab rather than within the Website I am displaying through the app. In the ViewController, I have: import UIKit import WebKit import CoreLocation class ViewController: UIViewController, WKNavigationDelegate { var webView: WKWebView! override func loadView() { webView = WKWebView() webView.navigationDelegate = self view = webView let url = URL(string: "https://domain.com")! webView.load(URLRequest(url: url)) webView.allowsBackForwardNavigationGestures = true webView.navigationDelegate = self } func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { if let url = navigationAction.request.url { if url.host != "https://domain.com" { UIApplication.shared.open(url) decisionHandler(.cancel) return } } decisionHandler(.allow) }} But, rather than it opening a new Safari browser when you tap onto an external link, when the app launches, the website I have contained within the app opens in Safari. Is there anything I can do to try and resolve this issue? Any help is appreciated.
Posted
by
Post not yet marked as solved
0 Replies
134 Views
Error instantiating template in Xcode: Error Domain=NSCocoaErrorDomain Code=642 "You can’t save the file “macOS (Extension)” because the volume is read only." UserInfo={NSFilePath=/YOU CAN READ IT Dyslexia won't stop you!/macOS (Extension), NSUnderlyingError=0x6000009a4270 {Error Domain=NSPOSIXErrorDomain Code=30 "Read-only file system"}}. Could not create project.
Posted
by
Post not yet marked as solved
0 Replies
165 Views
Hi, I have followed the instructions as per the documentation, and I am able to generate a pushPackage successfully. It seems to be only working on my safari browser, i.e. it asks me for the permission and upon granting the permission I do get a deviceToken. But when we try to visit the same site on my colleague's safari browser, it gives a permission denied in browser console, while the logs show "Signature verification of push package failed" Has someone else faced this issue before?
Posted
by
Post not yet marked as solved
1 Replies
405 Views
We are deploying a .net Webapp and running it on iOS and Android devices. On iOS 15 and later, if the app is on the homescreen, then run, put in background and then come back, all inputs like datepicker and selects are not working anymore. So if you click on the select, nothing happens. A restart of the app helps, but if the app is set in background, the same happens again. I've read from others having the same problems, is there anything done against it? Also tried this for iOS 15.4 Beta 4. At the moment we are asking our customers to use the app in safari and not on the homescreen to prevent the freezing. One example input and select: &lt;input data-clear-btn="false" data-db-class="some_db_class" data-db-name"some_db_name" data-db-typ="date" type="date" id="some_id" value="" data-inline="true"&gt; &lt;select data-mini="true" data-inline="true" class="some_class" &lt;option value="-1"&gt;Auswahl treffen...&lt;/option&gt; &lt;option value="0"&gt;Beispiel&lt;/option&gt; &lt;/select&gt;
Posted
by
Post not yet marked as solved
0 Replies
244 Views
Hi all! Right now I'm trying to implement the SSO (single sign-on) feature for my applications. I have the common-auth domain and a couple of apps (domain AAA and domain BBB). While I'm in domain AAA I sign in with the common-auth domain and got an access token (JWT) as a cookie. Then I continue interactions with the AAA domain. After that, I open the domain BBB in a new tab. The application automatically makes a query to the common-auth server. I expect that the access token cookie, which I got from AAA, will be added to the query. But it's not. I can't fully understand why it's not working. Everything is fin in Chrome, IE, and Firefox. Obviously, there are some restrictions with cookies in Safari. But I'm just a backend developer and right now feel a bit frustrated. How can I bypass that problem? What parameters should I add to the cookie to handle cookie sharing? Would be appreciated any advice or links to docs. PS. I won't use cookies for tracking or for some advertisements. Only for improving user experience.
Posted
by
Post not yet marked as solved
0 Replies
299 Views
Requirement : Safaridriver provide option to disable Use Mock Capture Devices when use webdriver. Problem : In Mac OS, when use Safaridriver open a Safari browser for WebRTC samples, the audio input source only display Mock device (audio: Mock audio device 1/ Mock audio device 2 , video: Mock video device 1/ Mock video device 2) but not display Mac OS physical audio/video device . From safaridriver readMe, seems no configure can set Use Mock Capture Devices , because WebDrier test not support live media capture "For security reasons, Safari does not permit live media capture during a WebDriver test session. Instead, mock capture devices and streams with well-known contents are provided for testing purposes. " (In Mac OS, cd/Library/Apple/System/Library/CoreServices/SafariSupport.bundle/Contents/MacOS , man safaridriver)  From safaridriver debug log, safaridriver not provide any configure for disable Mock device. Reference : WebRTC samples link: https://webrtc.github.io/samples/src/content/devices/input-output/ safaridriver debug logs: [safaridriver.82081.txt] (https://developer.apple.com/forums/content/attachment/3806528b-d972-4459-8647-d4e6a4aae20a) Reproduce demo: SafariDriverDebug.java pom.xml dependency:
Posted
by