JavaScript

RSS for tag

Discuss the JavaScript programing language.

JavaScript Documentation

Posts under JavaScript tag

88 Posts
Sort by:
Post not yet marked as solved
13 Replies
162 Views
We found that canvas of the same size is more blurry in iOS 16 Beta 3. Here's the code: <!DOCTYPE html> <html lang="en"> <head> <title>Document</title> <style> #app { height: 586px; width: 1170px; } </style> </head> <body> <canvas height="586px" width="1170px" id="app"></canvas> <script> const el = document.getElementById('app'); const ctx = el.getContext('2d'); ctx.font = '80px Arial'; ctx.fillText('Hello World', 100, 100) </script> </body> </html> Oddly enough, if you set the height of the code above to 585 px(one pixel less), the text on the canvas becomes clear. This will only happen with iOS Beta 3. ref: https://bugs.webkit.org/show_bug.cgi?id=242847
Posted
by yezengyue.
Last updated
.
Post not yet marked as solved
0 Replies
66 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 =&gt; { btn.addEventListener('click', function (e) { var lang = e.srcElement.getAttribute('data-language'); changeLang(lang) }) }) } clickChange(); setTimeout(() =&gt; { 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 Last updated
.
Post marked as solved
6 Replies
1.4k Views
I'm seeing an issue with a PWA when added to the home screen. The Keyboard will eventually stop opening. when clicking on an input field. this happens with bmw.com, instagram.com. Once it happens on one PWA, all PWA's are effected. Is this a known issue?
Posted
by notsle.
Last updated
.
Post not yet marked as solved
3 Replies
2.8k Views
With the latest iOS 15 beta releases we have started seeing issues with memory and canvases. This error is not reproduced in any of the earlier iOS versions (with any devices), it is only present in the new iOS 15 beta versions. The warning about total canvas memory is always followed with a javascript exception trying to do rendering on the canvas: This is an history of it working in a iPhone 12 pro max with iOS 14.7.1. This is history of it not working with an iPhone 11 with iOS 15 beta 5 (confirmed with beta 4 as well) There are a couple of observations we've made: It seems it is more easily reproduced by repeatedly triggering the new url bar and rotating the device a lot. Clearing History and Website Data can fix the issue temporarily When it is reproduced it can easily be reproduced again, even when reloading the page.
Posted Last updated
.
Post not yet marked as solved
1 Replies
323 Views
I want to install a GitHub repository and nvm command therefore I need the java virtual machine. When I check the "java -version in zsh I always get this Error Error: Could not create the Java Virtual Machine. What would you suggest since it is installed JavaVirtualMachines/jdk-18.0.1.jdk?
Posted
by Matt29.
Last updated
.
Post not yet marked as solved
0 Replies
142 Views
Hi. The registration process with WebAuthn works fine and expected. As we use the same code on both android and ios, we dont use discoverable credentials, but instead saves the credential-id in a cookie. If an user deletes his cookie, we can not see if the user has registered previously without prompting the user for registration again. This is okay, and if we get an InvalidStateError (because the user is already registered) we let the user think he has registered again, and just creates a new cookie. The problem is: When the navigator.credentials.create is called, the InvalidStateError is catched immideately, before the user have time to do anything about the faceID prompt which shows. When the InvalidStateError is caught, the Registration Completed page shows. This means the completed page is shown behind the face-id prompt, which is very confusing for the user. How can the registration be completed if the face-id prompt is not finished? On Windows, the error is not thrown before the user has completed the faceid prompt, which means the registration-process is experienced exactly as a first-time registration. Is it a bug that the prompt is shown after the error is thrown? Any tips to how i can work around this? If this is not the right forum to ask - where is a better place? Best regards, Nina
Posted
by ninamwa.
Last updated
.
Post not yet marked as solved
0 Replies
137 Views
I built a simple recorder on my website for users to record and playback audio. It works on ALL desktop browsers (including Safari) but when I use any browser on my iPhone, the mic is active at the opposite time. The flow is: ask permission > user allows mic access > user presses record > records audio > saves and plays back On iPhone what's happening is after the user allows permission, the mic goes active (visualized by the mic icon in safari browser) and then once the user presses record, it disables the mic. I am using getUserMedia within a React.js app Why is it doing this?
Posted
by alybla97.
Last updated
.
Post not yet marked as solved
0 Replies
128 Views
When triggering a webkitRequestFullscreen event in response to a pointerdown event, the result is a fullscreen error. Using a pointerup event instead of pointerdown works fine. I'm using a <button> element to receive the event and in the event listener callback I'm attempting to call webkitRequestFullscreen() on a div. Is this expected behavior? note: this was observed using MacOS Simulator: iPad 9th Generation - iOS 15.4
Posted
by dbuss1.
Last updated
.
Post not yet marked as solved
2 Replies
550 Views
I am getting this issue while trying to load my application with node js. I think it's got to do with some some settings but im not sure. This is running under M1 chip imac. Feeling frustrated hope someone can help me out! architecture (have 'x86_64', need 'arm64e')), mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))
Posted Last updated
.
Post not yet marked as solved
0 Replies
125 Views
Hello, i would like to know if anyone knows how the Tik Tok button to works to share a video from this plataform in Instagram stories, that is, the button opens editing mode with the video already included. I would be needing to make a similar button for an application. i tried entering URLs from my phone like: "//instagram.com/create/story" but it doesn´t even open the story editing mode. Thank you very much.
Posted Last updated
.
Post not yet marked as solved
1 Replies
229 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 neillu.
Last updated
.
Post not yet marked as solved
0 Replies
122 Views
We have implemented two sliders in a website "website url-Perennial? Seasonal? Always special (duckstein.de)". These slider are working properly on android devices and other windows browsers. But why these sliders are not working in safari? Please help on it for a solution.
Posted Last updated
.
Post marked as solved
1 Replies
546 Views
Hello Safari 15.4 window.open freezes both parent and child tabs Made a github page where you can reproduce the bug: https://swanty.github.io/pdfjs-safari/broken.html It happens only when special conditions are met: The broken.html page loads Stripe v3 js file (important for the freeze) Upon clicking CLICK ME the code executes window.open().location = '...';, thus both parent and child tabs are linked together in the same process The second page opens the latest release of mozilla pdf.js that loads .pdf that contains only 1 image (the image is important for the freeze) Image is simply 3000x3000 PNG, 1 color, 1.2 kB file created with photopea, nothing special, except the resolution. PDF I created by dragging the .png into Chrome and clicking Print -> Save as pdf, also nothing special, just a regular pdf. On our production web if I navigate pages in same tab and at any point that stripe JS is loaded and then I navigate to a different page where window.open().location = '...' opens that pdf.js + .pdf file with special image then both tabs freeze. It doesn't matter how many times I navigate the pages (in same tab), it seems that once the stripe js is loaded, it lingers in the tab memory somewhere and causes the freeze. I would really appreciate it if someone from the Safari developer team could take a look at this and help find a solution :) Thank you
Posted
by Swanty.
Last updated
.
Post not yet marked as solved
1 Replies
368 Views
I would like to create a web app where you can drag and drop emails from Apple Mail (on macOS). When you drag emails to the desktop an .eml file is created, but when you drag emails to the browser no file is being transferred, I can only get the mail’s subject. So is it possible to drag and drop emails from Apple Mail to browsers? And if yes, then how? So far I've tried chrome and safari, but neither got any files with the dragged element. On windows with outlook or thunderbird this wasn’t an issue, so I hope it can be done with apple mail as well. Thanks in advance
Posted Last updated
.
Post not yet marked as solved
9 Replies
533 Views
I have an app built using python with pyinstaller. I was able to successfully get the app notarized and open it on my computer as well as a different one (OS 11.6.1). I can also get the pkg successfully notarized, but when I attempt to launch it on my own computer (or a different one), an error box immediately appears stating "There was an error reading the package" along with "JavaScriptError." I looked at the log file corresponding to the notarization, and I saw no error messages or warnings. Neither "java" nor "javascript" appear anywhere. This was not a problem for me a couple weeks ago when using a slightly different version of my program. Is there a different log file of some type, associated with javascript, that might shed light on the problem? Update: I did just try to check whether package passed the gatekeeper test by typing spctl -a '/Users/..../application.pkg' at the terminal, which returned "rejected"
Posted
by fishbacp.
Last updated
.
Post not yet marked as solved
1 Replies
210 Views
I was working on a project where I used the HTMLAudioElement to record an audio response. While playing the audio on iPhone, I noticed that the sound came just from the ear speaker and not the loud speaker which is desired by the user. Is there a way to select the output to come out of the loud speaker as in the former case the user can't hear the preview audio properly?
Posted
by jchawla.
Last updated
.
Post not yet marked as solved
0 Replies
349 Views
When I am applying the CSS property "position: fixed" on the body a white space appears at the bottom of the screen. steps to reproduce the issue: open any page on ios safari hide the address bar by scrolling up apply css property position fixed on body You will see the extra space at the bottom of the screen. This area will be filled with address bar if the address bar is open.
Posted Last updated
.