plusui-native-core 0.1.38 → 0.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90,49 +90,56 @@ Window Window::create(void *windowHandle, const WindowConfig &config) {
90
90
  .c_str(),
91
91
  nullptr);
92
92
 
93
- // Hide scrollbars if disabled via comprehensive CSS injection
93
+ // Hide scrollbars if disabled via CSS injection
94
94
  if (!pImpl->config.scrollbars) {
95
95
  std::string scrollbarScript = R"(
96
96
  (function() {
97
- // Critical: Apply inline styles to prevent scrollbars
98
- if (document.documentElement) {
99
- document.documentElement.style.cssText = 'margin:0 !important;padding:0 !important;overflow:hidden !important;width:100%;height:100%;';
100
- }
101
- if (document.body) {
102
- document.body.style.cssText = 'margin:0 !important;padding:0 !important;overflow:hidden !important;width:100%;height:100%;';
103
- }
97
+ // Apply inline styles directly - immediate effect
98
+ try {
99
+ if (document.documentElement) {
100
+ document.documentElement.style.overflow = 'hidden';
101
+ document.documentElement.style.margin = '0';
102
+ document.documentElement.style.padding = '0';
103
+ }
104
+ } catch (e) {}
104
105
 
105
- // Create comprehensive style element
106
- var style = document.createElement('style');
107
- style.type = 'text/css';
108
- style.textContent = 'html,body{margin:0!important;padding:0!important;overflow:hidden!important;width:100%;height:100%;position:fixed;top:0;left:0;}*{scrollbar-width:none;}::-webkit-scrollbar{display:none!important;width:0!important;height:0!important;}body *{overflow:hidden!important;}';
109
-
110
- function applyStyle() {
111
- try {
112
- if (document.head) {
113
- document.head.insertBefore(style, document.head.firstChild);
114
- } else if (document.documentElement) {
115
- document.documentElement.insertBefore(style, document.documentElement.firstChild);
116
- } else {
117
- setTimeout(applyStyle, 10);
118
- return;
119
- }
120
- } catch (e) {}
121
- }
106
+ // Inject CSS stylesheet
107
+ try {
108
+ var style = document.createElement('style');
109
+ style.textContent = 'html{overflow:hidden!important;margin:0!important;padding:0!important;height:100%!important;}body{overflow:hidden!important;margin:0!important;padding:0!important;height:100%!important;}::-webkit-scrollbar{display:none!important;width:0!important;height:0!important;}';
122
110
 
123
- applyStyle();
111
+ if (document.head) {
112
+ document.head.appendChild(style);
113
+ } else if (document.documentElement) {
114
+ document.documentElement.appendChild(style);
115
+ } else {
116
+ setTimeout(function() {
117
+ if (document.head) {
118
+ document.head.appendChild(style);
119
+ } else if (document.documentElement) {
120
+ document.documentElement.appendChild(style);
121
+ }
122
+ }, 10);
123
+ }
124
+ } catch (e) {}
124
125
 
125
- // Also apply when DOM is fully ready
126
- if (document.readyState === 'loading') {
127
- document.addEventListener('DOMContentLoaded', function() {
126
+ // Reapply on DOMContentLoaded
127
+ try {
128
+ var reapply = function() {
128
129
  if (document.documentElement) {
129
130
  document.documentElement.style.overflow = 'hidden';
130
131
  }
131
132
  if (document.body) {
132
133
  document.body.style.overflow = 'hidden';
133
134
  }
134
- });
135
- }
135
+ };
136
+
137
+ if (document.readyState === 'loading') {
138
+ document.addEventListener('DOMContentLoaded', reapply);
139
+ } else {
140
+ reapply();
141
+ }
142
+ } catch (e) {}
136
143
  })();
137
144
  )";
138
145
  pImpl->webview->AddScriptToExecuteOnDocumentCreated(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plusui-native-core",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "PlusUI Core framework (frontend + backend implementations)",
5
5
  "type": "module",
6
6
  "files": [