Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language like HTML.

Posts under CSS tag

125 Posts

Post

Replies

Boosts

Views

Activity

Apple iOS Does Not Support SVG Maps
I have developed an embedded svg map with links on it to display booking availability, but Apple iOS is unable to process the colors or the links. I used an svg map with a links wrapped around entries. The map displays perfectly on Windows/Android, but all Apple iOS devices I've tested (Macbook Pro and iPhone, multiple browsers) are unable to process the colors and links. Any advice on how to proceed (or convert the html map into something Apple devices can actually load) would be greatly appreciated. Apple support told me they do not offer support for issues such as this. Map: https://hsfm-booking-maps.s3.amazonaws.com/Farmer%27s+Market+-+Sunday%2C+October+2nd%2C+2022
1
0
1.6k
Sep ’22
HTML Select list disconnects from related field on IPAD keyboard collapse
IPAD, when you tab in input it shows keyboard and again when tab to select, option automatically pops up and keyboard collapse at this time option menu disconnects from select . To reproduce it , Please note this is IPAD Bug. code is below <!DOCTYPE html> <html> <body> <h1>The select element</h1> <p>The select element is used to create a drop-down list.</p> <form action="/action_page.php"> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <input> <label for="cars">Choose a car:</label> <select name="cars" id="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit"> </form> <p>Click the "Submit" button and the form-data will be sent to a page on the server called "action_page.php".</p> </body> </html>
0
1
1.2k
Aug ’22
Build a website
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? And what is the WebKit, can I still use it to build web pages using SwiftUI? If someone has the right answer, please help me. Thanks.
2
0
3.1k
Aug ’22
Build a website from scratch
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? If someone has the right answer, please help me. Thanks.
Topic: Safari & Web SubTopic: General Tags:
1
0
1.2k
Aug ’22
CSS Background Image Issue
Hi, I have a fixed scrolling background image on my recipe pages, they appear to work fine on android devices but on apple mobile safari the image is not sized correctly. I am new to fixing issues directly related to safari, so could someone with a little apple knowledge help? Thank you Example Recipe URL: https://lovefoodfeed.com/recipe/potato-salad/ This is the image URL: https://lovefoodfeed.com//wp-content/uploads/2022/07/Potato-salad-recipe-05wp.webp
0
0
1.1k
Aug ’22
HTML video showing black screen but sound is playing on iOS 15
My website shows a video using video tag which worked perfectly until not long ago. The video is working but when pressing on full screen, the video is playing but the screen is black while the sound is still playing. The issue occurs only on iPhones with iOS 15 (using Safari and Chrome also). Things I've tried: I've tried playing the video directly with a URL to the actual file(to check its not codec issue) and it worked properly. My video tag has 'position: absolute;' on it and I tried removing it(even though it breaks my layout) and that didn't work either. Tried pausing the video immediately and playing it after the video loads. Tried applying a background: white; or any non-transparent color to the video tag. Tried removing auto play. Tried to disable 'GPU process: Media' on safari settings just to check if that affects anything and it didnt. This is the html: <video data-test-id="long-video" #longVideo muted controls playsinline [class.d-none]="!isShortVideoHidden" *ngIf="isPageLoaded" src="https://cdn1.someurl.com/videos/commercial_1.mp4" type="video/mp4"> </video> and the css(with the parent): @media only screen and(min-width:992px) { .fixed-video { position: fixed; z-index: 10000; margin: auto; width: 100vw; height: 100vh; left: 0; top: 0; bottom: 0; right: 0; background: rgba(0, 0, 0, 0.5); transition: 0.4s; video { width: 80%; left: 0; right: 0; top: 0; bottom: 0; margin: auto; } } } Please tell me if you have struggled with this and know how to solve it. Thank you :)
3
1
5.1k
Aug ’22
Xcode and eps32 wifi/ble
hello, I'm pretty new to programming (swift,c++,html, css) I've started working with esp32 to make a home automation project with personal interface. I'm finding lots of problems to get this going.. at the moment I've tried couple of things: connect testLed to esp32 to see if code & interface works. first I tried with AsyncWebServer & made a custom webpage with html with the ledbutton. when I push the button the led turns on/off correctly.. Problem: 5-6second delay.. I've tried the same apStyle, remaining the delay... when I make my custom app with Xcode & make actions to go to the url with paths /on, /off I can control the led with my custom Xcode app.. still remaining a delay of 5-6seconds.. Question: How can I fix everything so it's a max delay of 1second? (I'll post all of my code after this post) or is the problem cause of the contact server & not directly contact esp32? would ble be better for this project? in my opninion not cause I would like to control everything from anywhere... ble means I need to be at home to maintain connection.. I've been looking up, changing code, & not going anywhere anymore :( tried different GPIO's for led.. coding only for one or 2led's to keep it minimal to optimize, & afterwards expand to the full home with relais en mosfet connections.. working with homekit & homespan is working good, but also delayed 3seconds.. better then what I have but still to slow..
1
0
1.4k
Jul ’22
iOS 14 and browser scroll bars (webkit)
Hello! I have this scrollable container. It works fine across browsers and devices until it hits iOS14. Behaves just the way it should iOS 12 - (cant test iOS13 right now) The goal is to always show the scrollbar. On iOS14 only the native scrollbar is shown when scrolling is happening. Is there any way to fix this for iOS14 users? thanks in advance! div {&#9; max-height: 20rem; &#9;overflow-x: hidden; &#9;overflow-y: auto; &#9;margin-right: 0.25rem; &#9;::-webkit-scrollbar-track { &#9;&#9;border-radius: 0.125rem; &#9;&#9;background-color: lightgray; &#9;} &#9;::-webkit-scrollbar { &#9;&#9;width: 0.25rem; &#9;&#9;border-radius: 0.125rem; &#9;} &#9;::-webkit-scrollbar-thumb { &#9;&#9;border-radius: 0.125rem; &#9;&#9;background-color: gray;}; &#9;} }
6
1
21k
Jul ’22
CSS files cached always
Hi Guy's,insteadI hope Apple developers also reading this articles, because the functionality of Safari development for Mac OS and iOS is strongly recomended to be changed.First at all I have working on simple site with css styles and html with small additions of Java and see next bug's (or features) provided by apple team.When I'm using safari 13 Develop console and set up ignore cache feature in Network tab is working for all content (html, fonts etc.) instead css stylesheets files. Css content still got by safari from memory and this is ver stupid idea. Always when I need to see my changes I have clean all cached data from all sites using Cmd + Option + R key combination. This method is unusable.More from this - I have connect iPhone with last iOS and mobile Safari version and do the same. Previous version has clean mobile safari cache when I do this action. Buit new version of Development console cleans only Mac Cache data not mobile cache. So, to check the site new look I need clean all mobile saved data included cache, cookies and other saved using my Safari on mobile device.I can't explain who has develop this, but he should be fired and strongly disabled from availiablity to work in IT for all his life. I really hope the solution is found by this community and I'll be grateful to see answers with solution in this thread. Thanks a lot,Alexander.
3
1
2.7k
Jun ’22
SF Fonts web font allowed?
I am a web developer.I would like to show off San Francisco fonts to the world.Apple San Francisco fonts [https://developer.apple.com/fonts], includes five font families, found here:Download SF Pro Text, Download SF Compact, Download SF Mono, Download New York, Download SF SymbolsI am developing a website to reduces loss of life and property.Storm-Link.netI am NOT a lawyer, and I need a YES or NO answer.Can I use the San Francisco Fonts as web fonts?EXAMPLEFor those who do not understand Web Development, this means converting each SF Font to a web font format.The standard web font formats are WOFF and WOFF2, beside either TTF or OTF.So the web fonts for SF-Mono_regular.otf are:SF-Mono_regular.otf, SF-Mono_regular.woff and SF-Mono_regular.woff2Coded like this in CSS..code { font-family: 'SF Mono', monospace; }.Deployed online ashttps://MySite/SF-Mono_regular.otf and https://MySite/SF-Mono_regular.woff and https://MySite/SF-Mono_regular.woff2.
9
1
31k
May ’22
Safari 14.1 and css class
Strange behaviour: when displaying an html file from the computer everything is ok, when the page is displayed from the web server, some class don't work. The class is some very simple like .viola { color: #xxxxxx; } The strange behavior act only with some colours. Some work, some not. On other browsers the page works fine.
0
0
723
May ’22
Rendering bug and element flickering in Safari 15.4.1
Since the Safari update to 15.4.1, our platform with various CSS transitions, transforms and animations has major rendering problems. Various elements (images/text/areas) are loaded multiple times and flicker very ugly. The same elements placed on another side of the platform don't have the problem. There seems to be some layers conflict and the z-index is not working properly. A workaround is that we set "transformation: translateZ(0)" at the lowest level. This stops the flickering of the elements, but the repainting of the elements remains, which is not optimal in terms of resource consumption. Safari 15.5 Beta-3 doesn't solve the problem.
0
3
3.2k
Apr ’22
Local Safari extension can't access CSS file
I recently converted my Chrome extension to a Safari extension using the Apple Conversion tool (XCode CLI). The extension is developed with ReactJS and SaSS. It works very well on Google Chrome but when I try it on Safari after converting it, the local extension works but the CSS file that handles the extension is not applied. There are no errors during the conversion but the Safari developer tool indicates several errors : console tab : Failed to load resource: You are not allowed to access the required resource. network tab : An error occurred while trying to load the resource and the resource was requested in an insecure manner. In the extension, we isolate CSS using iframe : /*global chrome*/ /* src/content.js */ import React from 'react'; import ReactDOM from 'react-dom'; import Frame, { FrameContextConsumer }from 'react-frame-component'; import "./content.css"; class Main extends React.Component { render() { return ( <Frame head={[<link type="text/css" rel="stylesheet" href={chrome.runtime.getURL("/static/css/content.css")} ></link>]}> <FrameContextConsumer> { // Callback is invoked with iframe's window and document instances ({document, window}) => { // Render Children return ( <div className={'my-extension'}> <h1>Hello world - My first Extension</h1> </div> ) } } </FrameContextConsumer> </Frame> ) } } Here is the manifest.json file: { "short_name": "My Extension", "name": "My Extension", "version": "1.0", "manifest_version": 3, "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "action": { "default_icon": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "default_title": "" }, "background": { "service_worker": "background.js" }, "content_scripts" : [ { "matches": ["<all_urls>"], "css": ["/css/root.css"], "js": ["/static/js/content.js"] } ], "permissions": [ "activeTab", "scripting", "storage" ], "host_permissions": ["https://www.google.com/*"], "web_accessible_resources": [{ "resources": [ "/static/css/content.css", "/static/media/*" ], "matches": ["<all_urls>"] }] } After many attempts, I did not understand the exact origin of the problem and I do not know how to solve it. Do you have any suggestions ?
1
2
1.2k
Apr ’22
evaluateJavaScript:completionHandler: Works on iPhone, not on iPad?
My app has HTML pages for content, and I have a button-triggered action to change the size of the text by using a set of functions that stepwise increases the WebKit webview text by changing the class of the document body (i.e."smallestText" = CSS webkit-text-size-adjust:80%) using the code below as the last step. On the iPhone simulator, this works perfectly but on the iPad simulator the text size does not change even though the functions are called, the javascriptString is correct, and the _webview contains the web content. I thought this might be a doctype version issue (most of the pages are HTML 4.01 strict) but changed it to HTML5 (!DOCTYPE html) with no change. Any ideas? (void)refreshWebview { NSString *javaScriptString = [NSString stringWithFormat:@"document.body.className = '%@'", self.fontSizeName]; [_webview evaluateJavaScript:javaScriptString completionHandler:nil]; }
0
0
1.1k
Apr ’22
App download badge - embed code
Does anyone know where I can find the embed code for the Apple Download Badge for apps? I have tried ITunes link Maker but there is no-where on it for Apps. I managed to get the Google badge in seconds but for Apple it seems it’s like trying to find the holy grail. I’ve been through 3 different support contacts who have now referred me here. I would really appreciate any up to date info on how to find the code. many thanks!
5
1
21k
Apr ’22
Broken css on IOS 15.4
Hey guys! I've got a website and it works fine for every device, except for those using IOS 15.4, i've readed the update notes, but theres nothing that indicates which is the problem on my code or what can i do to solve. Im using NextJS and Styled Components. Here's what happens, i've tested in other IOS's and other devices and it works fine, it's just in those with 15.4 update. Here's how it should work.
0
0
975
Mar ’22
Safari 13 not send js/css request after shelved several days
After my user shelved Safari for a long time and did not close it (a few days), he was unable to request our webpage. After investigation, it was found that the CDN resource request was not sent out. At the same time, chrome is accessed normally. After restarting Safari browser or dig CDN host, it can be accessed normally. I suspect that it is a cache bug of safari 13. It seems that some cache headers of CDN can trigger this bug, resulting in the failure to request resources normally Reproduce Safari version: 13.0.3, 13.0.5, 13.1.3.
1
0
983
Mar ’22
Apple iOS Does Not Support SVG Maps
I have developed an embedded svg map with links on it to display booking availability, but Apple iOS is unable to process the colors or the links. I used an svg map with a links wrapped around entries. The map displays perfectly on Windows/Android, but all Apple iOS devices I've tested (Macbook Pro and iPhone, multiple browsers) are unable to process the colors and links. Any advice on how to proceed (or convert the html map into something Apple devices can actually load) would be greatly appreciated. Apple support told me they do not offer support for issues such as this. Map: https://hsfm-booking-maps.s3.amazonaws.com/Farmer%27s+Market+-+Sunday%2C+October+2nd%2C+2022
Replies
1
Boosts
0
Views
1.6k
Activity
Sep ’22
HTML Select list disconnects from related field on IPAD keyboard collapse
IPAD, when you tab in input it shows keyboard and again when tab to select, option automatically pops up and keyboard collapse at this time option menu disconnects from select . To reproduce it , Please note this is IPAD Bug. code is below <!DOCTYPE html> <html> <body> <h1>The select element</h1> <p>The select element is used to create a drop-down list.</p> <form action="/action_page.php"> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> <input> <label for="cars">Choose a car:</label> <select name="cars" id="cars"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="opel">Opel</option> <option value="audi">Audi</option> </select> <br><br> <input type="submit" value="Submit"> </form> <p>Click the "Submit" button and the form-data will be sent to a page on the server called "action_page.php".</p> </body> </html>
Replies
0
Boosts
1
Views
1.2k
Activity
Aug ’22
Build a website
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? And what is the WebKit, can I still use it to build web pages using SwiftUI? If someone has the right answer, please help me. Thanks.
Replies
2
Boosts
0
Views
3.1k
Activity
Aug ’22
Build a website from scratch
Hello developers! I have a question about which programming language is good for building a website. I searched on the internet and it says that CSS and HTML are the most used, so suppose I want to use CSS, now the question is: where can I code to build the website? For example if I want to code in SwiftUI there are some apps (Xcode and Swift Playgrounds) to do it, but how can I do with the website in CSS? If someone has the right answer, please help me. Thanks.
Topic: Safari & Web SubTopic: General Tags:
Replies
1
Boosts
0
Views
1.2k
Activity
Aug ’22
CSS Background Image Issue
Hi, I have a fixed scrolling background image on my recipe pages, they appear to work fine on android devices but on apple mobile safari the image is not sized correctly. I am new to fixing issues directly related to safari, so could someone with a little apple knowledge help? Thank you Example Recipe URL: https://lovefoodfeed.com/recipe/potato-salad/ This is the image URL: https://lovefoodfeed.com//wp-content/uploads/2022/07/Potato-salad-recipe-05wp.webp
Replies
0
Boosts
0
Views
1.1k
Activity
Aug ’22
HTML video showing black screen but sound is playing on iOS 15
My website shows a video using video tag which worked perfectly until not long ago. The video is working but when pressing on full screen, the video is playing but the screen is black while the sound is still playing. The issue occurs only on iPhones with iOS 15 (using Safari and Chrome also). Things I've tried: I've tried playing the video directly with a URL to the actual file(to check its not codec issue) and it worked properly. My video tag has 'position: absolute;' on it and I tried removing it(even though it breaks my layout) and that didn't work either. Tried pausing the video immediately and playing it after the video loads. Tried applying a background: white; or any non-transparent color to the video tag. Tried removing auto play. Tried to disable 'GPU process: Media' on safari settings just to check if that affects anything and it didnt. This is the html: <video data-test-id="long-video" #longVideo muted controls playsinline [class.d-none]="!isShortVideoHidden" *ngIf="isPageLoaded" src="https://cdn1.someurl.com/videos/commercial_1.mp4" type="video/mp4"> </video> and the css(with the parent): @media only screen and(min-width:992px) { .fixed-video { position: fixed; z-index: 10000; margin: auto; width: 100vw; height: 100vh; left: 0; top: 0; bottom: 0; right: 0; background: rgba(0, 0, 0, 0.5); transition: 0.4s; video { width: 80%; left: 0; right: 0; top: 0; bottom: 0; margin: auto; } } } Please tell me if you have struggled with this and know how to solve it. Thank you :)
Replies
3
Boosts
1
Views
5.1k
Activity
Aug ’22
Xcode and eps32 wifi/ble
hello, I'm pretty new to programming (swift,c++,html, css) I've started working with esp32 to make a home automation project with personal interface. I'm finding lots of problems to get this going.. at the moment I've tried couple of things: connect testLed to esp32 to see if code & interface works. first I tried with AsyncWebServer & made a custom webpage with html with the ledbutton. when I push the button the led turns on/off correctly.. Problem: 5-6second delay.. I've tried the same apStyle, remaining the delay... when I make my custom app with Xcode & make actions to go to the url with paths /on, /off I can control the led with my custom Xcode app.. still remaining a delay of 5-6seconds.. Question: How can I fix everything so it's a max delay of 1second? (I'll post all of my code after this post) or is the problem cause of the contact server & not directly contact esp32? would ble be better for this project? in my opninion not cause I would like to control everything from anywhere... ble means I need to be at home to maintain connection.. I've been looking up, changing code, & not going anywhere anymore :( tried different GPIO's for led.. coding only for one or 2led's to keep it minimal to optimize, & afterwards expand to the full home with relais en mosfet connections.. working with homekit & homespan is working good, but also delayed 3seconds.. better then what I have but still to slow..
Replies
1
Boosts
0
Views
1.4k
Activity
Jul ’22
Html part elements not display on page in Safari
Hello! In iPhone 15.5, intermittently, some parts of one page, especially the top area, are covered with something that is not the screen I was working on. And if you scroll, that area disappears and you can see the html areas I coded in the past. how can i solve this?
Replies
2
Boosts
0
Views
3.3k
Activity
Jul ’22
iOS 14 and browser scroll bars (webkit)
Hello! I have this scrollable container. It works fine across browsers and devices until it hits iOS14. Behaves just the way it should iOS 12 - (cant test iOS13 right now) The goal is to always show the scrollbar. On iOS14 only the native scrollbar is shown when scrolling is happening. Is there any way to fix this for iOS14 users? thanks in advance! div {&#9; max-height: 20rem; &#9;overflow-x: hidden; &#9;overflow-y: auto; &#9;margin-right: 0.25rem; &#9;::-webkit-scrollbar-track { &#9;&#9;border-radius: 0.125rem; &#9;&#9;background-color: lightgray; &#9;} &#9;::-webkit-scrollbar { &#9;&#9;width: 0.25rem; &#9;&#9;border-radius: 0.125rem; &#9;} &#9;::-webkit-scrollbar-thumb { &#9;&#9;border-radius: 0.125rem; &#9;&#9;background-color: gray;}; &#9;} }
Replies
6
Boosts
1
Views
21k
Activity
Jul ’22
Issue with HTML select element in iOS 15 beta 8
On iOS 15 beta, when I tried to check my application, the select element is having issue. As when I clicked on select dropdown, the option list was not shown. The error message was "Failed to present a context menu for configuration with identifier".
Replies
5
Boosts
3
Views
5.4k
Activity
Jun ’22
CSS files cached always
Hi Guy's,insteadI hope Apple developers also reading this articles, because the functionality of Safari development for Mac OS and iOS is strongly recomended to be changed.First at all I have working on simple site with css styles and html with small additions of Java and see next bug's (or features) provided by apple team.When I'm using safari 13 Develop console and set up ignore cache feature in Network tab is working for all content (html, fonts etc.) instead css stylesheets files. Css content still got by safari from memory and this is ver stupid idea. Always when I need to see my changes I have clean all cached data from all sites using Cmd + Option + R key combination. This method is unusable.More from this - I have connect iPhone with last iOS and mobile Safari version and do the same. Previous version has clean mobile safari cache when I do this action. Buit new version of Development console cleans only Mac Cache data not mobile cache. So, to check the site new look I need clean all mobile saved data included cache, cookies and other saved using my Safari on mobile device.I can't explain who has develop this, but he should be fired and strongly disabled from availiablity to work in IT for all his life. I really hope the solution is found by this community and I'll be grateful to see answers with solution in this thread. Thanks a lot,Alexander.
Replies
3
Boosts
1
Views
2.7k
Activity
Jun ’22
SF Fonts web font allowed?
I am a web developer.I would like to show off San Francisco fonts to the world.Apple San Francisco fonts [https://developer.apple.com/fonts], includes five font families, found here:Download SF Pro Text, Download SF Compact, Download SF Mono, Download New York, Download SF SymbolsI am developing a website to reduces loss of life and property.Storm-Link.netI am NOT a lawyer, and I need a YES or NO answer.Can I use the San Francisco Fonts as web fonts?EXAMPLEFor those who do not understand Web Development, this means converting each SF Font to a web font format.The standard web font formats are WOFF and WOFF2, beside either TTF or OTF.So the web fonts for SF-Mono_regular.otf are:SF-Mono_regular.otf, SF-Mono_regular.woff and SF-Mono_regular.woff2Coded like this in CSS..code { font-family: 'SF Mono', monospace; }.Deployed online ashttps://MySite/SF-Mono_regular.otf and https://MySite/SF-Mono_regular.woff and https://MySite/SF-Mono_regular.woff2.
Replies
9
Boosts
1
Views
31k
Activity
May ’22
Safari 14.1 and css class
Strange behaviour: when displaying an html file from the computer everything is ok, when the page is displayed from the web server, some class don't work. The class is some very simple like .viola { color: #xxxxxx; } The strange behavior act only with some colours. Some work, some not. On other browsers the page works fine.
Replies
0
Boosts
0
Views
723
Activity
May ’22
Rendering bug and element flickering in Safari 15.4.1
Since the Safari update to 15.4.1, our platform with various CSS transitions, transforms and animations has major rendering problems. Various elements (images/text/areas) are loaded multiple times and flicker very ugly. The same elements placed on another side of the platform don't have the problem. There seems to be some layers conflict and the z-index is not working properly. A workaround is that we set "transformation: translateZ(0)" at the lowest level. This stops the flickering of the elements, but the repainting of the elements remains, which is not optimal in terms of resource consumption. Safari 15.5 Beta-3 doesn't solve the problem.
Replies
0
Boosts
3
Views
3.2k
Activity
Apr ’22
Local Safari extension can't access CSS file
I recently converted my Chrome extension to a Safari extension using the Apple Conversion tool (XCode CLI). The extension is developed with ReactJS and SaSS. It works very well on Google Chrome but when I try it on Safari after converting it, the local extension works but the CSS file that handles the extension is not applied. There are no errors during the conversion but the Safari developer tool indicates several errors : console tab : Failed to load resource: You are not allowed to access the required resource. network tab : An error occurred while trying to load the resource and the resource was requested in an insecure manner. In the extension, we isolate CSS using iframe : /*global chrome*/ /* src/content.js */ import React from 'react'; import ReactDOM from 'react-dom'; import Frame, { FrameContextConsumer }from 'react-frame-component'; import "./content.css"; class Main extends React.Component { render() { return ( <Frame head={[<link type="text/css" rel="stylesheet" href={chrome.runtime.getURL("/static/css/content.css")} ></link>]}> <FrameContextConsumer> { // Callback is invoked with iframe's window and document instances ({document, window}) => { // Render Children return ( <div className={'my-extension'}> <h1>Hello world - My first Extension</h1> </div> ) } } </FrameContextConsumer> </Frame> ) } } Here is the manifest.json file: { "short_name": "My Extension", "name": "My Extension", "version": "1.0", "manifest_version": 3, "icons": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "action": { "default_icon": { "16": "icon16.png", "48": "icon48.png", "128": "icon128.png" }, "default_title": "" }, "background": { "service_worker": "background.js" }, "content_scripts" : [ { "matches": ["<all_urls>"], "css": ["/css/root.css"], "js": ["/static/js/content.js"] } ], "permissions": [ "activeTab", "scripting", "storage" ], "host_permissions": ["https://www.google.com/*"], "web_accessible_resources": [{ "resources": [ "/static/css/content.css", "/static/media/*" ], "matches": ["<all_urls>"] }] } After many attempts, I did not understand the exact origin of the problem and I do not know how to solve it. Do you have any suggestions ?
Replies
1
Boosts
2
Views
1.2k
Activity
Apr ’22
evaluateJavaScript:completionHandler: Works on iPhone, not on iPad?
My app has HTML pages for content, and I have a button-triggered action to change the size of the text by using a set of functions that stepwise increases the WebKit webview text by changing the class of the document body (i.e."smallestText" = CSS webkit-text-size-adjust:80%) using the code below as the last step. On the iPhone simulator, this works perfectly but on the iPad simulator the text size does not change even though the functions are called, the javascriptString is correct, and the _webview contains the web content. I thought this might be a doctype version issue (most of the pages are HTML 4.01 strict) but changed it to HTML5 (!DOCTYPE html) with no change. Any ideas? (void)refreshWebview { NSString *javaScriptString = [NSString stringWithFormat:@"document.body.className = '%@'", self.fontSizeName]; [_webview evaluateJavaScript:javaScriptString completionHandler:nil]; }
Replies
0
Boosts
0
Views
1.1k
Activity
Apr ’22
App download badge - embed code
Does anyone know where I can find the embed code for the Apple Download Badge for apps? I have tried ITunes link Maker but there is no-where on it for Apps. I managed to get the Google badge in seconds but for Apple it seems it’s like trying to find the holy grail. I’ve been through 3 different support contacts who have now referred me here. I would really appreciate any up to date info on how to find the code. many thanks!
Replies
5
Boosts
1
Views
21k
Activity
Apr ’22
Broken css on IOS 15.4
Hey guys! I've got a website and it works fine for every device, except for those using IOS 15.4, i've readed the update notes, but theres nothing that indicates which is the problem on my code or what can i do to solve. Im using NextJS and Styled Components. Here's what happens, i've tested in other IOS's and other devices and it works fine, it's just in those with 15.4 update. Here's how it should work.
Replies
0
Boosts
0
Views
975
Activity
Mar ’22
Web development environment
I want to change web development environment. do you have good ones? I want to know what Myles used. Please check out 9:30 of this video. https://developer.apple.com/videos/play/wwdc2021/10029/
Replies
4
Boosts
0
Views
2.7k
Activity
Mar ’22
Safari 13 not send js/css request after shelved several days
After my user shelved Safari for a long time and did not close it (a few days), he was unable to request our webpage. After investigation, it was found that the CDN resource request was not sent out. At the same time, chrome is accessed normally. After restarting Safari browser or dig CDN host, it can be accessed normally. I suspect that it is a cache bug of safari 13. It seems that some cache headers of CDN can trigger this bug, resulting in the failure to request resources normally Reproduce Safari version: 13.0.3, 13.0.5, 13.1.3.
Replies
1
Boosts
0
Views
983
Activity
Mar ’22